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 ) { |
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 Rockstars_Widget { | |
private $custom_settings = array(); | |
public function register_default_widget( $sidebar, $class_name, $settings ) { | |
global $_wp_sidebars_widgets, $wp_widget_factory; | |
if( empty( $_wp_sidebars_widgets[ $sidebar ] ) ) { | |
if( isset( $wp_widget_factory->widgets[ $class_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 | |
/** | |
* Create HTML list of pages. | |
* | |
* @package WordPress | |
* @since 2.1.0 | |
* @uses Walker | |
*/ | |
class Walker_Page_Parent_Only extends Walker { |
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 Connection_Wordpress { | |
private $base_url = 'http://api.wordpress.org/'; | |
function __construct() { | |
add_action( 'widgets_init', array( $this, '_register_widgets' ) ); | |
} | |
function _register_widgets() { |
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 Marko_Shortcodes { | |
public function __construct() { | |
add_shortcode( 'engine_info', array( $this, 'engine_info' ) ); | |
} | |
public function engine_info( $atts ) { | |
global $wp_version, $wpdb, $batcache, $wp_object_cache; |
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( 'wp_ajax_image-editor', 'fix_wp_ajax_image_editor', 0 ); | |
function fix_wp_ajax_image_editor() { | |
$attachment_id = intval( $_POST['postid'] ); | |
if ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) | |
wp_die( -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
<?php | |
class Responsive_Childtheme_Enqueue { | |
public function __construct() { | |
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) ); | |
} | |
public function wp_enqueue_scripts() { | |
wp_deregister_style( 'responsive-style' ); | |
wp_register_style( 'responsive-style', get_template_directory_uri() . '/style.css', false, get_responsive_template_version() ); |
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 Nav_Menu_Widget_Classname { | |
public function __construct() { | |
add_action( 'widget_display_callback', array( $this, 'menu_different_class' ), 10, 2 ); | |
} | |
public function menu_different_class( $settings, $widget ) { | |
if( $widget instanceof WP_Nav_Menu_Widget ) | |
add_filter( 'wp_nav_menu_args', array( $this, 'wp_nav_menu_args' ) ); |
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 Gallery_Javascript { | |
private $link; | |
function __construct() { | |
add_filter( 'post_gallery', array( $this, 'enqueue_script' ), 20, 2 ); | |
add_filter( 'gallery_style', array( $this, 'add_class' ) ); | |
} |