This file contains hidden or 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 // Ignore this line. | |
add_action( 'save_post', 'nice_fix_yoast_seo_loading', -999 ); | |
add_action( 'delete_post', 'nice_fix_yoast_seo_loading', -999 ); | |
function nice_fix_yoast_seo_loading() { | |
if ( ! class_exists( 'WPSEO_Link_Watcher' ) ) { | |
return; | |
} | |
nice_loader( 'includes/public/theming/' ); |
This file contains hidden or 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
body.nice-framework-page-demos .nice-toggle .nice-toggle-inner { | |
height: auto !important; | |
border: 2px solid transparent !important; | |
} |
This file contains hidden or 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 | |
// Prevent Airplane Mode from blocking Google Fonts. | |
add_filter( 'airplane_mode_parse_style', function( $value, $parsed ) { | |
if ( 'fonts.googleapis.com' === $parsed ) { | |
$value = false; | |
} | |
return $value; | |
}, 10, 2 ); |
This file contains hidden or 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 | |
/** | |
* Obtain the path to the admin directory. | |
* | |
* @return string | |
*/ | |
function my_plugin_get_admin_path() { | |
// Replace the site base URL with the absolute path to its installation directory. | |
$admin_path = str_replace( get_bloginfo( 'url' ) . '/', ABSPATH, get_admin_url() ); | |
This file contains hidden or 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
# CREATE: On the root folder of a Git repository: | |
$ git submodule add [email protected]:nicethemes/<repo>.git location/of/submodule | |
# Cloning a repo that contains submodules: | |
$ git clone --recursive [email protected]:nicethemes/<repo>.git location/of/repo | |
# Or: | |
$ git clone [email protected]:nicethemes/<repo>.git location/of/repo | |
$ git submodule init | |
$ git submodule update |
This file contains hidden or 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 | |
/** | |
* Remove query arguments from any enqueued scripts. | |
*/ | |
function remove_query_args( $src ) { | |
if ( strpos( $src, 'ver=' ) ) { | |
$src = remove_query_arg( 'ver', $src ); | |
} | |
return $src; | |
} |
This file contains hidden or 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 | |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { | |
add_action( 'wp_ajax_wpsc_migrate_anonymous_user', '_wpsc_meta_migrate_anonymous_user_worker' ); | |
add_action( 'wp_ajax_nopriv_wpsc_migrate_anonymous_user', '_wpsc_meta_migrate_anonymous_user_worker' ); | |
function _wpsc_meta_migrate_anonymous_user_worker() { | |
global $wpdb; |
This file contains hidden or 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 | |
// Remove users and meta data. | |
function fix_wpsc_clear_customer_meta() { | |
global $wpdb; | |
require_once( ABSPATH . 'wp-admin/includes/user.php' ); | |
$purge_count = 200; | |
$sql = " | |
SELECT user_id | |
FROM {$wpdb->usermeta} | |
WHERE |
This file contains hidden or 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( 'option_active_plugins', 'activate_local_plugins' ); | |
/** | |
* Add our local plugins to the list of active plugins. | |
*/ | |
function activate_local_plugins( $plugins ) { | |
if ( defined( 'WP_STAGE' ) && 'local' == WP_STAGE ) { | |
$local_plugins = array( | |
'wordpress-beta-tester/wp-beta-tester.php', | |
'wordpress-importer/wordpress-importer.php', |
This file contains hidden or 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 | |
/** | |
* Load different configuration files for different stages. | |
*/ | |
if ( file_exists( $local_config = dirname( __FILE__ ) . '/local-config.php' ) ) { | |
require $local_config; // Configurations for your local stage only. | |
define( 'WP_STAGE', 'local' ); | |
} elseif ( file_exists( $staging_config = dirname( __FILE__ ) . '/staging-config.php' ) ) { | |
require $staging_config; // Configurations for your testing stage only. | |
define( 'WP_STAGE', 'staging' ); |
NewerOlder