Skip to content

Instantly share code, notes, and snippets.

<?php
printf(
__( 'Your color is %s.', 'sample-plugin' ),
$color
);
<div class="site-info">
<a href="http://wordpress.org/" >< ?php _e( 'Proudly powered by WordPress.', 'sample-plugin' ); ?></a>
</div>
printf(
_n(
'One comment',
'%s comments',
get_comments_number(),
'sample-plugin'
),
number_format_i18n( get_comments_number() )
);
define( 'DISALLOW_FILE_EDIT', true );
error_reporting(0);
@ini_set(‘display_errors’, 0);
<files wp-config.php>
order allow,deny
deny from all
</files>
add_action(‘template_redirect’, ‘bwp_template_redirect’);
function bwp_template_redirect()
{
if (is_author())
{
wp_redirect( home_url() ); exit;
}
}
add_filter( 'auto_update_plugin', '__return_true' );
// Activate WordPress Maintenance Mode
function wp_maintenance_mode(){
if(!current_user_can('edit_themes') || !is_user_logged_in()){
wp_die('<h1 style="color:red">Website under Maintenance</h1><br />We are performing scheduled maintenance. We will be back online shortly!');
}
}
add_action('get_header', 'wp_maintenance_mode');