How do I disable a plugin enforced by my host (in mu-plugins)?

You disable mu-plugins by removing the plugin file from the mu-plugins directory. They are outside the normal plugin activation/deactivation cycle “and cannot be disabled except by removing the plugin file from the must-use directory, which is found in wp-content/mu-plugins by default.” I assume you don’t have the authority to remove the files. The plugins may … Read more

Add content to /wp-admin/plugin-install.php admin screens

Without extending the class, what can be done is adding a Custom Action Link: add_filter( ‘plugin_install_action_links’, ‘action_links_wpse_119218’, 10, 2 ); function action_links_wpse_119218( $links, $plugin ) { if( isset( $_GET[‘tab’] ) ) { switch( $_GET[‘tab’] ) { case ‘featured’: $links[‘my-action’] = “Tested up to <a href=”#”>{$plugin[‘tested’]}</a>”; break; case ‘popular’: $links[‘my-action’] = “Requires <a href=”#”>{$plugin[‘requires’]}</a>”; break; case … Read more

How do I extend one plugin I’m writing with another I’m writing using classes?

If the classes are not in the same file, you’ll need to require it into the child class ( myCustomClass ). Are you doing that? Example : //get the base class if(!class_exists(‘MyParentClass’)) { require_once plugin_dir_path( __FILE__ ) . ‘/_inc/MyParentClass.php’; } /** * Class Definition */ class MyChildClass extends MyParentClass{ // class definition }

echo value from ‘select’ field type into page template using cmb2?

For starters, I recommend you use the API for register metaboxes and fields which can be seen here: https://github.com/WebDevStudios/CMB2/wiki/Basic-Usage#create-a-metabox. To echo the select option’s label, you would do something like this: add_action( ‘cmb2_admin_init’, ‘custom_metabox’ ); function custom_metabox() { $cmb = new_cmb2_box( array( ‘id’ => REALIA_PROPERTY_PREFIX . ‘ficha_tecnica’, ‘title’ => ‘Ficha Técnica’, ‘object_types’ => array( ‘property’ … Read more

Problem requiring/including plugin files with plugin_dir_path( __FILE__ )

When using plugin_dir_path() like you do: plugin_dir_path( __FILE__ ); It does return something like: /var/www//wordpress/wp-content/plugins/your-plugin/ So it adds a trailing slash, because as the documentation states: It is a wrapper for trailingslashit( dirname( $file ) );. So remove the slash before the file in your calls: require_once plugin_dir_path( __FILE__ ) . ‘file.php’;

Why my browser keeps loading old version of custom JavaScript files in \divi\js? [closed]

First get datetime stamp of your js file’s last modification, and use it as fourth parameter of wp_enqueue_script function: $path=”full path to your script file”); $handle=”your_handle”; $src=”https://wordpress.stackexchange.com/questions/283374/path of the script, relative to the WordPress root directory”; $depts = array(); // dependencies, if any $ver = filemtime($path); $in_footer = false; wp_enqueue_script($handle, $scr, $depts, $ver, $in_footer); If … Read more