View fix-yoast-smart-issue.php
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 // 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/' ); |
View fix-demo-importer-toggle.css
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
body.nice-framework-page-demos .nice-toggle .nice-toggle-inner { | |
height: auto !important; | |
border: 2px solid transparent !important; | |
} |
View airplane-mode-google-fonts.php
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 | |
// 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 ); |
View get-admin-path.php
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 | |
/** | |
* 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() ); | |
View submodules.sh
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
# CREATE: On the root folder of a Git repository: | |
$ git submodule add git@bitbucket.org:nicethemes/<repo>.git location/of/submodule | |
# Cloning a repo that contains submodules: | |
$ git clone --recursive git@bitbucket.org:nicethemes/<repo>.git location/of/repo | |
# Or: | |
$ git clone git@bitbucket.org:nicethemes/<repo>.git location/of/repo | |
$ git submodule init | |
$ git submodule update |
View remove-query-args.php
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 | |
/** | |
* Remove query arguments from any enqueued scripts. | |
*/ | |
function remove_query_args( $src ) { | |
if ( strpos( $src, 'ver=' ) ) { | |
$src = remove_query_arg( 'ver', $src ); | |
} | |
return $src; | |
} |
View wpsc-meta-util-example.php
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 | |
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; |
View fix-sample.php
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 | |
// 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 |
View activate-plugins-by-stage.php
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( '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', |
View wp-config.php
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 | |
/** | |
* 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