This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'bulk_actions-edit-post', 'move_posts_bulk_multisite_actions' ); | |
function move_posts_bulk_multisite_actions( $bulk_array ) { | |
if( $sites = get_sites( array( | |
'site__not_in' => get_current_blog_id(), // excluding current blog | |
'number' => 50, | |
))) { | |
foreach( $sites as $site ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('body_class', 'add_slug_to_body_class'); | |
public function add_slug_to_body_class( $classes ) { | |
global $post; | |
if ( is_home() ) { | |
$key = array_search( 'blog', $classes ); | |
if ( $key > -1 ) { | |
unset( $classes[$key] ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Customize expires cache start - adjust the period according to your needs | |
<IfModule mod_expires.c> | |
FileETag MTime Size | |
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript | |
ExpiresActive On | |
ExpiresByType text/html "access 600 seconds" | |
ExpiresByType application/xhtml+xml "access 600 seconds" | |
ExpiresByType text/css "access 1 month" | |
ExpiresByType text/html "access 1 month" | |
ExpiresByType text/javascript "access 1 month" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
register_activation_hook( __FILE__, 'activation_check' ); | |
/* Test before activate the plugin */ | |
function activation_check() { | |
if ( ! is_plugin_active( 'pods/init.php' ) ) { | |
deactivate_plugins( plugin_basename( __FILE__ ) ); | |
wp_die( 'The plugin <a href="https://www.pods.io/">PODS</a> is prerequisite to run this Plugin.</p>' ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('show_admin_bar', '__return_false'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_notices', 'admin_notice__success' ); | |
function admin_notice__success() { | |
$class = 'notice notice-success is-dismissible'; | |
$message = __( 'Completelly with success!', 'text_domain' ); | |
printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) ); | |
} | |
add_action( 'admin_notices', 'admin_notice__error' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'bulk_actions-edit-post', 'new_bulk_actions' ); | |
function new_bulk_actions( $bulk_actions ) { | |
$bulk_actions['send_by_email'] = __( 'Send By E-mail', 'text_domain' ); | |
return $bulk_actions; | |
} | |
add_filter( 'handle_bulk_actions-edit-post', 'new_bulk_action_handler', 10, 3 ); | |
function new_bulk_action_handler( $redirect_to, $doaction, $post_ids ) { | |
/* Exit if it's not send by email action */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'cron_schedules', 'add_cron_interval' ); | |
function add_cron_interval( $intervals ) { | |
/* Add new cron interval */ | |
$intervals['one_minute'] = array( | |
'interval' => 60, /* It's not recomended cron schedules with less then 15 minutes */ | |
'display' => esc_html__( 'Every minute' ), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'pre_site_transient_update_core', 'remove_core_updates' ); /* Hide WordPress Core updates */ | |
add_filter( 'pre_site_transient_update_plugins', 'remove_core_updates' ); /* Hide Plugins updates */ | |
add_filter( 'pre_site_transient_update_themes', 'remove_core_updates' ); /* Hide Theme updates */ | |
/* Hide update notifications */ | |
function remove_core_updates(){ | |
global $wp_version; | |
return (object) array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'restrict_manage_posts', 'filter_posts_by_topics', 10, 2 ); | |
function filter_posts_by_topics( $post_type, $which ) { | |
/* Apply this only on a specific post type */ | |
if ( 'post' !== $post_type ) { | |
return; | |
} |
NewerOlder