Determine plugin name from within plugin_action_links filter

There are currently four filters and they carry lots of information: $prefix = $screen->in_admin( ‘network’ ) ? ‘network_admin_’ : ”; $actions = apply_filters( $prefix . ‘plugin_action_links’, array_filter( $actions ), $plugin_file, $plugin_data, $context ); $actions = apply_filters( $prefix . “plugin_action_links_$plugin_file”, $actions, $plugin_file, $plugin_data, $context ); This is a var dump of the parameters for Advanced Custom … Read more

Disable / Deregister all JS from all plugins

You could install a plug-in like asset Queue Manager to keep track of all the active stylesheets and javascript files (it’s preaty neat, you can live-preview how the page would look without an asset to see if your site gets broken or not), and then in your theme’s functions.php file, put a code like the … Read more

Hide plugin list

WordPress needs themes and plugins to be in web-accessible folder, so that any scripts and styles from them can be downloaded by browsers and work. From there it’s technologically easy to detect such resources in page source and/or proactively scan site for presence of files belonging to popular plugins. There is nothing to be done … Read more

register_theme_directory somehow “fails” when folder is outside of WP-Folder

While I cannot speak to your specific white-screen issue, registered theme directories must be within the Apache document root, at minimum. Many files in themes, such as CSS, JS, images, etc, are served directly by the webserver, not via calls to WordPress. So having a theme directory that is not directly accessible and serve-able by … Read more

WooCommerce “Save Changes” button appears inside custom settings

Ok, the fix is quite easy, although not obvious at all. All we need to do is just add array( ‘type’ => ‘sectionend’, ‘id’ => ‘test-options’ ), to the end of the settings group. So the final function should look like this: add_action( ‘woocommerce_settings_start’, ‘wpse8170_register_settings’ ); function wpse8170_register_settings() { global $woocommerce_settings; $woocommerce_settings[‘test’] = array( array( … Read more

wp_mail() is not working on server

Since PHP Mailer is working fine do you have the same credentials setup for wp_mail? If you’re using an authenticated SMTP for PHP Mailer then you’ll possibly need a plugin to get the authentication into wp_mail. There are a few different ones that all work but one is https://wordpress.org/plugins/wp-mail-smtp/ for example.

Woocommerce custom shared taxonomy

Found solution for this problem. It turned out that woocommerce affects post_type query variable in pre_get_posts filter without checking that another post_type has been requested. It’s done in WC_Query.product_query method: if ( ! $q->is_tax( ‘product_cat’ ) && ! $q->is_tax( ‘product_tag’ ) ) $q->set( ‘post_type’, ‘product’ ); Fix for this problem is simple. You just need … Read more

Plugin “Meta Box”: Implementing meta boxes in custom post type

In this instance you would need to find the hook into the specific metabox and add your custom post type to its pages array, for example: $meta_boxes[‘test_metabox’] = array( ‘id’ => ‘test_metabox’, ‘title’ => ‘Test Metabox’, ‘pages’ => array(‘post’,’page’,’artists’), //list custom post types here! ‘context’ => ‘normal’, ‘priority’ => ‘high’, The Meta Box plugin essentially … Read more

List users except current user using wp_dropdown_user? [closed]

Your problem is here: ‘exclude’ => ‘$user_id,1′, This will generate the string ‘$user_id,1’, it won’t insert the user ID into your string. The reason for this is the difference between ‘$hello’ and “$hello” E.g. $hello = 5; echo ‘$hello’; // prints out $hello echo “$hello”; // prints out 5 So using double rather than single … Read more