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 | |
| 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 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 | |
| /** | |
| * Create HTML list of pages. | |
| * | |
| * @package WordPress | |
| * @since 2.1.0 | |
| * @uses Walker | |
| */ | |
| class Walker_Page_Parent_Only extends Walker { |
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 | |
| 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 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_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 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 | |
| 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 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 | |
| class Load_External { | |
| private $jquery_path; | |
| private function load_external_jquery() { | |
| global $wp_scripts; | |
| $schema = is_ssl() ? 'https://' : 'http://'; |
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 | |
| 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 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_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 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
| <? | |
| 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 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 | |
| $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; |