Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('register_post_type_args', array($this, 'method__modify_post_args'), 150, 2);
- // method 2 (seems useless): child posts go to 404
- function method__modify_post_args($args,$p){
- // example of registered output: $args https://pastebin.com/raw/pNA5vjNn
- if($p=='post'){
- $args['hierarchical']=true;
- // 'query_var' doesnt change anything
- // $args['rewrite']=true; // causes fatal error, because rewriting yet not initialized
- $args['labels']["name"]="Posts";
- $args['labels']["singular_name"]="Post";
- //$args['label']="Posts"; //doesnt change anything.. more labels in: wp-includes/post.php
- }
- // example of set_args func: https://pastebin.com/raw/VxZAJcqC
- return $args;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement