How to define constant before plugin [duplicate]

Defining constants on the global scope instead of using WordPress hooks, the first plugin loaded (See answer linked by Kero) will get the chance to define the constant. However, you could use some of the API hooks in your plugin, the earliest one possible is plugins_loaded, and then you can set priorities for the callbacks … Read more

Why are my queries interfering with the global post variable?

$the_query->the_post(); is populating the global $post with each post in that loop. On front-end queries, you’d normally call wp_reset_postdata() after running a secondary query loop, but that doesn’t work on the admin side. Use get_posts instead of WP_Query, and iterate over the results with a foreach loop- $my_posts = get_posts( $args ); if( !empty( $my_posts … Read more

Problem with removing plugin action

What you’re doing will only remove an action added in a static method of class. From https://codex.wordpress.org/Function_Reference/remove_action If an action has been added from within a class, for example by a plugin, removing it will require accessing the class through a variable that holds the class instance. add_action( ‘wp_head’, ‘remove_my_class_action’ ); function remove_my_class_action(){ global $my_class; … Read more

Setup wp_schedule_event within a custom plugin

First of all: if you haven’t read it already, please check the official documentation on WP-Cron. The problem in your code is this line add_action( ‘setupCronJob_whatToMine’, ‘setupCronJob’); You’re defining a new action setupCronJob_whatToMine and add the setupCronJob method to it. But as this is a custom action you just created, it will never be called … Read more

Text only version of website [closed]

If you wanted to remove all colorful text from your site, you could use a global CSS rule, as in * {color:black !important; background-color:white !important} which should turn all text to black on white background. (The ‘*” should apply to all CSS elements.) That wouldn’t get rid of images or other things, so you might … Read more

Fullscreen Video/GIF Intro

The following code uses HTML5 Video, with the muted & autoplay attributes set. It takes the video, which I uploaded through the media gallery and displays it fullscreen. I’m using a script that detects when the video is done playing, then it fades out and is removed from the DOM. HTML <div class=”fullscreen-bg”> <video muted … Read more