Deregister scripts from plugin

There’s a much better and more reliable way than naming your plugin “ZZ” – use a delayed hook on plugins_loaded, which fires after all plugins are loaded: function wpse_191178_plugins_loaded() { // Do your stuff } add_action( ‘plugins_loaded’, ‘wpse_191178_plugins_loaded’, 100 );

BuddyPress: filter member based on Xprofile Field

Try: class BP_Custom_User_Ids { private $custom_ids = array(); public function __construct() { $this->custom_ids = $this->get_custom_ids(); add_action( ‘bp_pre_user_query_construct’, array( $this, ‘custom_members_query’ ), 1, 1 ); add_filter( ‘bp_get_total_member_count’, array( $this, ‘custom_members_count’ ), 1, 1 ); } private function get_custom_ids() { global $wpdb; //figure out if the logged-in user is engineer or it $s = xprofile_get_field_data( 2, bp_loggedin_user_id() … Read more

WordPress Custom Menu Admin helper plugin

Add this to functions.php, or put the CSS into a css file which is loaded in the admin screen. This will let the box become resizable, so you can make it taller and see more pages/checkboxes at once. function wp191833_resize_menu_list() { ?> <style type=”text/css”> #wpwrap .categorydiv div.tabs-panel, #wpwrap .customlinkdiv div.tabs-panel, #wpwrap .posttypediv div.tabs-panel, #wpwrap .taxonomydiv … Read more

Call Ajax URL in Plugin

Put below code in _construct() function and change action name to get_product_serial_callback :- add_action( ‘wp_ajax_get_product_serial_callback’, array($this,’get_product_serial_callback’) ); add_action( ‘wp_ajax_nopriv_get_product_serial_callback’, array($this,’get_product_serial_callback’ ));

How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?

It seems to me like this is just a regular addition to functions. Since you are asking, I think you may not be getting the result you are looking for. If this was my project, I would create a new plugin, install it into the regular plugin list so that it does not get overwritten … Read more

Enable Shortcode for Custom Wordress Widgets

Your shortcode function will register widget, will not display on a page as a shortcode. To show widget on a page/post you need to use the_widget( ‘test_widget’, $instance, $args ); function. Codex documentation is here For example, in your code // Display the widget function test_show_widget() { the_widget( ‘test_widget’ ); } add_shortcode(‘test_widget’, ‘test_show_widget’);

Show media-uploads to all users

The plugin you mentioned is only reportedly tested up to WordPress version 3.6.1. I would not (in general) recommend abandoned plugins, because they might impose security risks. Additionally it uses PHP4 class constructors, that might soon be deprecated and it calls non static methods in a static way. If you remove the plugin, you should … Read more

Restrict access to live site from public while showing small group the new site all on the same URL?

Put code below into your theme’s functions.php: add_action( ‘template_redirect’, function() { is_user_logged_in() || auth_redirect(); }); function fpw_custom_login_message() { $message=”<p style=”text-align: center”>Until this site goes public you need to be registered to see the content<br />&nbsp;</p>”; return $message; } add_filter(‘login_message’, ‘fpw_custom_login_message’);

Problem after updating plugins

There is problem with the “wordpress-seo” permission so please following steps. There are two way 1) Upload from the wp-admin Step 1 -> Change the “wordpress-seo” permission or rename the “wordpress-seo” plugin to another Step 2 -> If you have change the permission then just upgrade the plugin and if you have rename the plugin … Read more