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 | |
/* | |
Plugin Name: Plug Name v123 DEV | |
Plugin URI: https://v123.tw | |
Description: 插件簡述 | |
Version: 1.01.0 | |
Author: v123 DEV | |
Author URI: https://v123.tw | |
License: GPL2 | |
License URI: https://v123.tw |
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 | |
/* | |
* List All Post Type Names | |
* https://v123.tw | |
*/ | |
function v123_get_all_post_type_names(){ | |
global $wp_post_types; | |
$posttypes = array_keys( $wp_post_types ); |
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 | |
/* | |
* List All Post Type | |
* https://v123.tw | |
*/ | |
function v123_get_all_post_types(){ | |
global $wp_post_types; | |
print_r($wp_post_types); | |
} | |
add_action('init','v123_get_all_post_types'); |
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 | |
/* | |
* Convert Object To Array | |
* https://v123.tw | |
*/ | |
function WP_Query_arr(array $args){ | |
$default = array( | |
'showposts' => -1, | |
'post_type' => 'post', |
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 | |
/* | |
* Convert Object To Array | |
* https://v123.tw | |
*/ | |
$args = array( | |
'showposts' => -1, | |
'post_type' => 'post', | |
'post_status' => 'publish' |
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 | |
/* | |
* Convert Object To Array | |
* https://vector.cool | |
*/ | |
function obj_to_arr($obj){ | |
return (array) $obj; | |
} |
NewerOlder