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 | |
/* | |
* Convert Object To Array | |
* https://vector.cool | |
*/ | |
function obj_to_arr($obj){ | |
return (array) $obj; | |
} |
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 | |
/* | |
* Convert Object To Array | |
* https://v123.tw | |
*/ | |
$args = array( | |
'showposts' => -1, | |
'post_type' => 'post', | |
'post_status' => 'publish' |
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 | |
/* | |
* Convert Object To Array | |
* https://v123.tw | |
*/ | |
function WP_Query_arr(array $args){ | |
$default = array( | |
'showposts' => -1, | |
'post_type' => 'post', |
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 | |
/* | |
* 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 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 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 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 | |
/** | |
* 刪除 WordPress Divi Project post type. | |
* https://v123.tw | |
*/ | |
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 ); | |
function mytheme_et_project_posttype_args( $args ) { | |
return array_merge( $args, array( | |
'public' => false, | |
'exclude_from_search' => 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 | |
/** | |
* WordPress Remove notice and warning | |
* https://v123.tw | |
*/ | |
add_action('admin_print_scripts', 'ure_remove_admin_notices'); | |
function ure_remove_admin_notices() { | |
global $wp_filter; | |
if (is_user_admin()) { | |
if (isset($wp_filter['user_admin_notices'])) { |
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 | |
/** | |
* WordPress remove all notice and warning with user role editor | |
* https://v123.tw | |
*/ | |
add_filter('ure_role_additional_options', 'ure_add_block_admin_notices_option', 10, 1); | |
function ure_add_block_admin_notices_option($items) { | |
$item = URE_Role_Additional_Options::create_item('block_admin_notices', esc_html__('Block admin notices', 'user-role-editor'), 'admin_init', 'ure_block_admin_notices'); | |
$items[$item->id] = $item; | |
OlderNewer