Thanks to visit codestin.com
Credit goes to devdips.wordpress.com

Hello! Namaste!

Hello! I am a WordPress Developer living near Gujarat, India. When I am not writing code, you can find me exploring new places & nature or spending time with friend & family.

  • Validation for Block Settings

    For adding validation for block setting field with custom block, We can handle that easily with below component Using above component, you can create one state for each block and maintain global class for root block container to indicate if block has error. Here I added Example, how we can use above component with block…

  • How to add custom data to Gutenberg post editor.

    By default, Gutenberg Editor edit post request is not pass any custom param which we added with edit link. If you want to use that custom param in server side to perform some action, you need to pass that custom param manually. you can do that with following JS code.

    ,
  • Auto Transform Legacy Widget block to Native Widget

    With WordPress 5.8, Block based widget editor was introduce. WordPress provide a intermediate block to rending Classic widget called Legacy Widget block. In case, you want to convert this Classic Widget to Native block. Conversion will be like belowClassic Widget -> Legacy Widget block -> Native block– Classic Widget to Legacy widget block conversion will…

  • Pre-publish checks with Gutenberg

    Update block.js to something like:

    ,
  • ElasticSearch wild card query

    For enabling wild card or partial search query, we need to apply the following solution Ref: https://github.com/10up/ElasticPress/issues/1995 You can apply this solution by extending code using ep_formatted_args_query filter For debugging ep query argument before sending a request you can use ep_pre_request_args

    ,
  • WordPress PHPCS Setup with PHPStrom [ Project Level ]

    First, You need to add squizlabs/php_codesniffer and wp-coding-standards/wpcs package dependency into Project using composerRef: https://packagist.org/packages/squizlabs/php_codesnifferhttps://packagist.org/packages/wp-coding-standards/wpcs On composer install, It will fetch both packages. you can find the following file/folder in the vendor folder. vendor/bin/phpcs vendor/bin/phpcbf vendor/wp-coding-standards/wpcs Not PHPCS setup is ready to use. The next step is to configure in PHPStrom. Open PHPStrom > Preference…

    ,
  • Remove action/filters using class name?

    function remove_filters_for_anonymous_class($tag, $class, $method) { $filters = $GLOBALS[‘wp_filter’][$tag]; if (empty ($filters)) { return; } foreach ($filters as $priority => $filter) { foreach ($filter as $identifier => $function) { if (is_array($function) and is_a($function[‘function’][0], $class) and $method === $function[‘function’][1] ) { remove_filter( $tag, array($function[‘function’][0], $method), $priority ); } } } }

    ,
  • Cron job with WordPress

    Cron job with WordPress

    Many time cron will slow your site to end user. It’s little bit complex to debug. WP-Cron works different way. It’s not based on the server, or the server’s clock. In WordPress, It check every time a person calls one of your pages or posts. Every time WordPress goes to work, it checks to see…

Design a site like this with WordPress.com
Get started