is_rtl returns false while it should return true

Case 1 – is_rtl() is not working because it has been called directly. To use such contditional tags in WordPress, query should already be run. So such function should be used inside the function hooked to appropriate hook. Since it is called directly, its value will be always false. See https://developer.wordpress.org/themes/basics/conditional-tags/#where-to-use-conditional-tags Case 2 – It … Read more

Test my WordPress Plugin standard or not

There’s an official guideline https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/ but no automatic test tool for code quality and security. The plugin team will check your plugin and also gives you some recommendations if something doesn’t fit their standards. One of my plugins had to be changed to be approved. It’s a friendly team, they won’t reject your plugin without … Read more

WooCommerce: after install hook

WooCommerce itself isn’t setting fresh_site to 0 directly (the string fresh_site doesn’t appear anywhere in WooCommerce’s source code), however you are correct that it’s happening because WooCommerce is creating pages. WordPress sets a site to not be fresh like this (from wp-includes/default-filters.php): // Mark site as no longer fresh foreach ( array( ‘publish_post’, ‘publish_page’, ‘wp_ajax_save-widget’, … Read more

Activate and deactivate plugin automatically

I like the idea of running this through a schedule event in WordPress, https://codex.wordpress.org/Function_Reference/wp_schedule_event Here is a snippet that hopefully will get you there: <?php if(!wp_next_scheduled(‘daily_plugin_check’)){ wp_schedule_event( time(), ‘daily’, ‘daily_plugin_check’ ); } add_action( ‘daily_plugin_check’, ‘toggle_plugins’ ); function toggle_plugins() { switch(date(‘D’)){ case ‘Mon’ : case ‘Wed’ : case ‘Fri’ : // Could be an array or … Read more

Can’t delete a custom post in front end with custom role

Look at line 63 of the code https://developer.wordpress.org/reference/functions/map_meta_cap/ If you don’t provide a specific post, it is not allowed. Your code is mixing meta capabilities with primitive capabilities. (yours are all plural or primitive) “Meta” capabilities, e.g. ‘edit_post’, ‘edit_user’, etc., are capabilities used by map_meta_cap() to map to other “primitive” capabilities, e.g. ‘edit_posts’, ‘edit_others_posts’, etc. … Read more

Search Results Page filter by page title

While I think you are looking for a plugin, I think this answer might help some people who search for a similar answer. If you have access to your functions.php file, you can easily make this happen. First we’ll alter the orderby parameter of the search query in order to filter them by page title. … Read more