Get plugin_dir_url() from one level deep within plugin
In a subdirectory within your plugin directory you can use the following code: $this->plugin_location = plugin_dir_url(dirname(__FILE__));
In a subdirectory within your plugin directory you can use the following code: $this->plugin_location = plugin_dir_url(dirname(__FILE__));
Using WP-CLI you can specify this as described in the official documentation. $ wp plugin update <plugin> Using either of the following arguments –minor Only perform updates for minor releases (e.g. from 1.3 to 1.4 instead of 2.0) –patch Only perform updates for patch releases (e.g. from 1.3 to 1.3.3 instead of 1.4) –version=<version> If … Read more
add_action( ‘admin_init’, ‘do_something_152677’ ); function do_something_152677 () { // Global object containing current admin page global $pagenow; // If current page is post.php and post isset than query for its post type // if the post type is ‘event’ do something if ( ‘post.php’ === $pagenow && isset($_GET[‘post’]) && ‘post’ === get_post_type( $_GET[‘post’] ) ) … Read more
Firstly, you can’t immediately achieve the goal you described with the code you show in your question. To understand why there isn’t a direct approach with that code you have to take a look at what you’re using – woocommerce_related_products() – to do what you have done so far. Secondly, you have to understand, because … Read more
You could do this using the WordPress uninstall.php support: <?php if( ! defined( ‘WP_UNINSTALL_PLUGIN’ ) ) exit(); global $wpdb; $wpdb->query( “DROP TABLE IF EXISTS NestoNovo” ); delete_option(“my_plugin_db_version”); ?> This uninstall.php file is called when your plugin is deleted.
Here is an answer with some code that will do what you want it to do: Is there a way for a plug-in to get it’s own version number?
There’s a wpmu_options action that lets you append more HTML on the Network Settings page. If you want to add your own sub-menu/page to the Settings parent menu: add_action(‘network_admin_menu’, ‘add_my_netw_settings_page’); function add_my_netw_settings_page() { add_submenu_page( ‘settings.php’, ‘Co za asy’, ‘Co za asy’, ‘manage_network_options’, ‘my-netw-settings’, ‘your_form’ ); } function your_form(){ $options = get_site_option(‘your_plugin’); ?> <form action=”<?php echo … Read more
No core hacking needed — thanks to: HOOKS. Hooks allow to fix the issue with a nice combination of a filter replacing “–” by “, ” before output and an “if” block to make sure the output is not also filtered for the admin interface 🙂 and finally, saving all your tags with comma in … Read more
Plugins: Question and Answer Forum Plugin WP-Answers Plugin Themes: AskIt Instant Q&A
Here is a modified checklist, based on my current (work-in-progress) settings/data security checklist used for reviewing Themes (the principles should be no different for Plugins than they are for Themes): Plugins should prefix all options, custom functions, custom variables, and custom constants with plugin-slug. Plugins should implement Plugin Options and Plugin Settings pages deliberately, rather … Read more