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
<? | |
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 | |
$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
<?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 | |
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 My_Elasticsearch { | |
public function __construct() { | |
add_filter( 'elasticsearch_config_facets', array( $this, 'add_facets' ) ); | |
add_filter( 'elasticsearch_config_fields', array( $this, 'add_fields' ) ); | |
add_filter( 'elasticsearch_indexer_map_field', array( $this, 'indexer_map_field' ), 10, 2 ); | |
add_filter( 'elasticsearch_indexer_build_document', array( $this, 'indexer_build_document' ), 10, 2 ); | |
} |
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 wp_set_error_handler() { | |
if ( defined( 'E_DEPRECATED' ) ) | |
$errcontext = E_WARNING | E_DEPRECATED; | |
else | |
$errcontext = E_WARNING; | |
set_error_handler( function( $errno, $errstr, $errfile ) { | |
if ( 'wp-db.php' !== basename( $errfile ) ) { |
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
#!/bin/bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
LANGUAGES=( | |
"de:WordPress/Localization/LocalizedResources.de-DE.resx" | |
"es:WordPress/Localization/LocalizedResources.es-ES.resx" | |
"it:WordPress/Localization/LocalizedResources.it-IT.resx" | |
"ja:WordPress/Localization/LocalizedResources.ja-JP.resx" | |
"nl:WordPress/Localization/LocalizedResources.nl.resx" |
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
Index: tests/image/size.php | |
=================================================================== | |
--- tests/image/size.php (revision 1257) | |
+++ tests/image/size.php (working copy) | |
@@ -95,57 +95,6 @@ | |
$this->assertequals(array(525, 700), $out); | |
} | |
- function test_shrink_dimensions_default() { | |
- $out = wp_shrink_dimensions(640, 480); |
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
Index: tests/image/resize.php | |
=================================================================== | |
--- tests/image/resize.php (revision 1254) | |
+++ tests/image/resize.php (working copy) | |
@@ -6,107 +6,114 @@ | |
* @group upload | |
*/ | |
abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase { | |
- // image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_path=null, $jpeg_quality=75) | |
NewerOlder