What WordPress API function lists active/inactive plugins?
wp_get_active_and_valid_plugins() get_plugins() and get_option(‘active_plugins’)
wp_get_active_and_valid_plugins() get_plugins() and get_option(‘active_plugins’)
get_header( $name ) is a WordPress function, that will try to load the file header-{$name}.php from your theme’s root folder. If this file doesn’t exist, WordPress will load the default header.php file.
Have a look at the wp-settings.php file. You’ll see that the plugins_loaded action is triggered before the theme is loaded. The first action available for themes to hook into is the after_setup_theme action.
gear-solid**: Looking in the Source Code… Here’s the function from WP-DBManager Plugin that generates that error: function dbmanager_admin_notices() { $backup_options = get_option(‘dbmanager_options’); if(!@file_exists($backup_options[‘path’].’/.htaccess’)) { echo ‘<div class=”error” style=”text-align: center;”><p style=”color: red; font-size: 14px; font-weight: bold;”>’.__(‘Your backup folder MIGHT be visible to the public’, ‘wp-postratings’).'</p><p>’.sprintf(__(‘To correct this issue, move the <strong>.htaccess</strong> file from <strong>wp-content/plugins/wp-dbmanager</strong> to <strong>%s</strong>’, … Read more
You could definitely use an MVC philosophy in the development of a plugin, but you would be really silly to try to incorporate CI or Cake in addition to WP. For instance, you could build out a plugin using the following pseudo structure (FYI, there are a ton of ways to build this, depending on … Read more
Here’s another approach using the map_meta_cap filter that’s applied within the map_meta_cap() function within the has_cap() method of the WP_User class (PHP 5.4+): add_filter( ‘map_meta_cap’, function ( $caps, $cap, $user_id, $args ) { // Nothing to do if( ‘delete_post’ !== $cap || empty( $args[0] ) ) return $caps; // Target the payment and transaction post … Read more
The shop page is actually an archive page for posts of type ‘product’. Its template is in woocommerce/archive-product.php. You need to use the pre_get_posts action to preprocess the query before the loop, conditional_tags to recognize that you are in the product archive page, and a taxonomy query to filter the product categories, which belong to … Read more
You should not access the database directly, if at all possible. There are two main reasons for this: If the database structure changes (unlikely), your queries may become outdated. Using functions like delete_user_meta() will ensure that your query should work properly for all WordPress versions (past, present, and future) that support that function. Caching. If … Read more
There are two things that confuse people when trying to remove a hook: The remove_action() or remove_filter() calls must take place after the add_action() or add_filter() calls, and before the hook is actually fired. This means that you must know the hook when the calls were added and when the hook is fired. The remove_action() … Read more
This will handle appending the content to single posts: function yourprefix_add_to_content( $content ) { if( is_single() ) { $content .= ‘Your new content here’; } return $content; } add_filter( ‘the_content’, ‘yourprefix_add_to_content’ );