$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'); ?>custom field - extend Meta BoxDocument Panel|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)

custom field - extend Meta BoxDocument Panel

matteradmin9PV0评论

For a project, I'm trying to figure out the best way to implement a checkbox, related to a post type.

What I'm trying to to:

On the final website, there should be a dropdown-button, with upcoming events inside. I was thinking of creating a custom post type "events", which will then of course be rendered in that dropdown div.

Now on the post type "page" (or maybe some others as well), in the editing screen, I'd like to have a checkbox to enable "show recent events on this page".

1. My first Idea, was to extend the document panel on the right (wordpress 5 - Gutenberg) with an additional section, similar to the discussion section:

But the only way to change anything inside the document panel I found was creating a hook to either editor.PostFeaturedImage or editor.PostTaxonomyType, which will be inside a section and not adding a new one.

2. So my second Idea was an approach of using Gutenberg blocks. I was thinking of creating a Meta Block field, like I found in the documentation of Gutenberg but the problem with that is, that that the user would have to add the block himself first, when I would rather have it there by default and if possible not removable.

So my final question is, which option would be the better one to go with, or is there an even better way to do it and how could I fix the described problems above?

I appreciate all the help!

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far