Last active
October 13, 2020 00:11
-
-
Save ituki/21f7fcad58c9575622377199a7a23860 to your computer and use it in GitHub Desktop.
管理画面をカスタマイズしようとして$current_screen使ったら、 : Trying to get property of non-object inって言われた件 ref: https://qiita.com/ituki_b/items/039b6eb40283d46a04fc
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.php | |
if($current_screen->post_type == 'xxx') { | |
… | |
} |
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.php | |
if(isset($current_screen) && $current_screen->post_type == 'xxx') { | |
… | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment