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 | |
/* Use jQuery to target rating areas and add classes | |
------------------------------------------------------------ */ | |
add_action( 'admin_print_scripts', 'tgm_target_colors', 20 ); | |
function tgm_target_colors() { | |
global $current_screen; | |
if ( 'forms_page_gf_entries' !== $current_screen->id ) |
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
foreach ( $this->plugins as $plugin ) | |
add_option( TGMPA_SETTINGS, array( "tgmpa_dismiss_{$plugin['slug']}" => 1 ) ); |
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
/** Set type, based on whether the source starts with http:// or https:// */ | |
$type = preg_match('|^http(s)?://|', $plugin['source'] ) ? 'web' : 'upload'; | |
/** Prefix a default path to pre-packaged plugins */ | |
$source = ( 'upload' == $type ) ? $this->default_path . $plugin['source'] : $plugin['source']; | |
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) ); // Create a new instance of Plugin_Upgrader | |
$upgrader->install( $source ); // Perform the action and install the plugin from the $source URL | |
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
add_action( 'init', 'remove_stuff' ); | |
function remove_stuff() { | |
if ( class_exists( 'TGM_Soliloquy' ) ) | |
remove_action( 'tgmsp_soliloquy_settings', array( TGM_Soliloquy::$instance, 'output_soliloquy_plugin_settings' ) ); | |
} |
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
add_action( 'admin_notices', 'check_objects' ); | |
function check_objects() { | |
echo '<pre>' . print_r( TGM_Soliloquy::$instance, true ) . '</pre>'; | |
$test = new TGM_Soliloquy; | |
echo '<pre>' . print_r( $test, true ) . '</pre>'; | |
} |
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
public static function singleton() { | |
if ( ! isset( self::$instance ) ) | |
self::$instance = new __CLASS__; | |
return self::$instance; | |
} |
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
add_filter( 'tgmsp_output_meta_fields', 'remove_certain_fields' ); | |
function remove_certain_fields( $fields ) { | |
unset( $fields['alt'] ); | |
return $fields; | |
} |
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
function nirvana_install() { | |
global $wpdb; | |
$table = 'dynamic_sidebars'; | |
$dynamic_sidebars = $wpdb->prefix . $table; | |
$sql = $wpdb->prepare( "CREATE TABLE $dynamic_sidebars ( | |
dynamic_sidebar_id BIGINT(20) NOT NULL AUTO_INCREMENT, | |
sidebar_name VARCHAR(255) NOT NULL, | |
sidebar_id VARCHAR(255) NOT NULL, |
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
add_filter( 'wp_nav_menu_objects', 'tgm_filter_nav_menu', 10, 2 ); | |
function tgm_filter_nav_menu( $objects, $args ) { | |
echo '<pre>' . print_r( $objects, true ) . '</pre>'; | |
echo '<pre>' . print_r( $args, true ) . '</pre>'; | |
} |
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
add_filter( 'wp_nav_menu_args', 'tgm_custom_nav_menu_args' ); | |
function tgm_custom_nav_menu_args( $args ) { | |
$args['unique'] = $args['theme_location']; | |
return $args; | |
} | |
add_filter( 'wp_nav_menu_objects', 'tgm_filter_nav_menu', 10, 2 ); |
OlderNewer