##Data: { "post_meta": [ { "ID": 33, "key": "my_key", "value": "value1" }, { "ID": 34,
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 | |
include( __DIR__ . '/wp-load.php' ); | |
const MAXTIMES = 10000; | |
class WP_Form { | |
static $forms = array(); | |
var $object_id; | |
var $form_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 | |
/** | |
* Class WP_Object_Classifier | |
*/ | |
final class WP_Object_Classifier { | |
/** | |
* @var bool | |
*/ | |
var $object_type = 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
namespace Whatever { | |
class Object { | |
/** | |
* @param Object $object | |
*/ | |
function foo( $object ) { | |
} |
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 get_foo( $state, $method ) { | |
$value = null; | |
if ( method_exists( $this, $method ) ) { | |
/** | |
* PhpStorm INCORRECTLY identifies $value as NOT being used later. |
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 | |
if ( WPLib::is_development() ) { | |
define( 'WP_DEBUG', true ); | |
} else { | |
define( 'WP_DEBUG', 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
/* | |
Makes WordPress' PressThis use vimeo short code instead of <object>/<embed> tags. | |
Add this to the WordPress theme's function.php file. | |
Addresses the Vimeo question from StackExchange here: | |
http://webapps.stackexchange.com/questions/3834/customizing-press-this-quick-posting-for-wordpress | |
*/ | |
add_action('admin_print_footer_scripts','greatjakes_admin_print_footer_scripts'); | |
function greatjakes_admin_print_footer_scripts() { | |
if ($_SERVER['PHP_SELF']=='/wp-admin/press-this.php') { | |
$script=<<<SCRIPT |
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 | |
/* | |
wp-all-posts-for-any-term-in-a-taxonomy.php | |
This is an example showing a hook used to add the ability to use "any" as a term to match all terms for a taxonomy. | |
It will run as a standalone file in the root of a WordPress 3.0 install with a URL that looks like: | |
http://example.com/wp-all-posts-for-any-term-in-a-taxonomy.php | |
It was written to address this question: |
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 | |
include "wp-load.php"; | |
$post_id = $_GET['post']; | |
$menu_id = $_GET['menu']; | |
global $wpdb; | |
$result = $wpdb->get_results($wpdb->prepare("SELECT t.term_id as menu_id, | |
t.name AS 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 | |
include "wp-load.php"; | |
$post_id = $_GET['post']; | |
$menu_id = $_GET['menu']; | |
$term = get_term($menu_id, 'nav_menu'); | |
$menu_items = new WP_Query( |
OlderNewer