$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Page-parent field not appearing in editor|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Page-parent field not appearing in editor

matteradmin9PV0评论
Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 6 years ago.

Improve this question

The drop-down of page parents doesn't appear in some sites as of upgrading to WordPress 5.0.+

Closed. This question is off-topic. It is not currently accepting answers.

Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?

Closed 6 years ago.

Improve this question

The drop-down of page parents doesn't appear in some sites as of upgrading to WordPress 5.0.+

Share Improve this question asked Jan 23, 2019 at 8:32 Andre ClementsAndre Clements 1347 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -1

It seems the problem is with shortcodes, specifically if they echo any content - which of course they shouldn't. We had shortcodes registered to programmatically generate content on some pages on the front-end of the site but the functions the short-codes call appear to get called from the backend, even when creating a new page that doesn't call the shortcode, breaking the lazy-loading of that field.

As a quick fix I wrapped the function's content in a is_page() test and that seems to fix the problem:

`add_shortcode('my_shortcode_str', 'my_shortcode_fx');

 function my_shortcode_fx() {
    if (is_page()) {
      /* only render on front-end, otherwise kills lazy load of page parent field in WP edit screen */
      $content =  /*something*/;
      return $content;
    } // ends is_page
 }
`

The proper solution is to make sure the shortcode's function only returns the content and doesn't output anything itself.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far