How can I enqueue a style only when a particular widget is active?

You need to modify this a little bit. class Organiser extends WP_Widget { … function __construct() { add_action( ‘wp_enqueue_scripts’, array(‘Organiser’, ‘register_plugin_styles’) ); … } public function widget( $args, $instance ) { wp_enqueue_style( ‘organiserStyle’ ); include(dirname(__FILE__).”/organiserWidget.php”); } static function register_plugin_styles() { wp_register_style( ‘organiserStyle’, plugins_url( ‘organiser/css/organiserStyle.css’ ) ); // wp_register_style( ‘organiserStyle’, plugin_dir_url( __FILE__ ) . ‘css/organiserStyle.css’ ); … Read more

Is there a way to expose additional fields to the Bulk Action > Edit functionality?

A quick google search yielded these results for me: https://premium.wpmudev.org/blog/wordpresss-bulk-edit/ https://wordpress.org/plugins/custom-bulkquick-edit/ https://wordpress.org/plugins/tags/bulk-edit/ I am sure there is a way, but I do not think that there is a WP API for that (like options API or transients API, etc…). Maybe you can see what these free plugins are doing and how. Edit: I found the … Read more

changing variable through filters or action hooks

It won’t work the way you are doing it, but you are close. The reason you have to use a global is that you aren’t setting your $meta variable with the information returned from the filter. This: do_action(‘alter_loop’,$meta); Should be this: $meta = apply_filters(‘alter_loop’,$meta); Note: “Actions” do not return values. “Actions” do things. “Filters” accept … Read more

delay function on publish?

publish_post is called after post is published! So, you already got covered. but if you want to run an action after a certain time of the post is published, it’s better to write a cron job. For example, if you need to run the function after 5 minutes of the post is published, you need … Read more