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 | |
$string = get_the_title(); | |
$last_character = $string[ strlen( $string ) - 1 ]; | |
echo substr( $string, 0, -1 ) . '<span>' . $last_character . '</span>'; | |
?> |
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( 'generate_rewrite_rules', 'specialpage_rewrite' ); | |
function specialpage_rewrite( $wp_rewrite ) { | |
$extra_rules = array( | |
'special-page/?$' => 'index.php?show_special_page=1', | |
); | |
$wp_rewrite->rules = $extra_rules + $wp_rewrite->rules; |
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( 'init', array( &$this, 'change_post_object_label' ), 0 ); | |
add_action( 'admin_menu', array( &$this, 'change_post_menu_label' ), 0 ); | |
add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages') ); | |
function change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
if( isset( $menu[5], $submenu['edit.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 | |
$cdn_activated = false; | |
if( function_exists( 'w3_instance' ) ) { | |
$cdn_activated = w3_instance('W3_Config')->get_boolean( 'cdn.enabled' ); | |
@set_time_limit( w3_instance('W3_Config')->get_integer('timelimit.cdn_import') ); | |
} | |
$upload_dir = wp_upload_dir(); | |
$file = 'test/somefile.png'; | |
$new_location = $upload_dir[ 'baseurl' ] . $file; |
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 get_menu_title( $theme_location, $default_name = 'menu' ) { | |
if ( $theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $theme_location ] ) ) { | |
$menu = wp_get_nav_menu_object( $locations[ $theme_location ] ); | |
if( $menu && $menu->name ) { | |
return $menu->name; | |
} | |
} |
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( 'in_widget_form', 'extend_recent_posts_form', 10, 3 ); | |
add_filter( 'widget_update_callback', 'extend_recent_posts_update', 10, 4 ); | |
add_filter( 'widget_title', 'extend_recent_posts_init_query_filter', 10, 3 ); | |
add_filter( 'widget_posts_args', 'extend_recent_posts_query' ); | |
function extend_recent_posts_form( $widget, $return, $instance ) { | |
if( ! is_a( $widget, 'WP_Widget_Recent_Posts' ) ) | |
return; |
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 | |
class Sidebar_Horizontal { | |
public $end_row = '<div class="clearfix"></div>'; | |
private $registered = array(); | |
private $counter = array(); | |
function __construct() { | |
add_filter( 'dynamic_sidebar_params', array( &$this, '_sidebar_params' ) ); |
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 | |
class Load_External { | |
private $jquery_path; | |
private function load_external_jquery() { | |
global $wp_scripts; | |
$schema = is_ssl() ? 'https://' : 'http://'; |
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 | |
function rockstars_register_default_widget( $sidebar, $class_name, $settings ) { | |
global $rockstars_widgets; | |
if( !is_admin() ) { | |
return $rockstars_widgets->register_default_widget( $sidebar, $class_name, $settings ); | |
} | |
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( 'pre_get_posts', 'media_filter_user' ); | |
add_filter( 'query', 'media_filter_counter' ); | |
// Main stuff that filters it | |
function media_filter_user( $query ) { | |
global $pagenow; | |
if( 'media-upload.php' == $pagenow ) { |
OlderNewer