$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'); ?>Theme Development: Starter Content after hook|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)

Theme Development: Starter Content after hook

matteradmin10PV0评论

I'm making a Wordpress theme that generate placeholder menus using the theme support "starter content". I read the documentation and is very vague: /.

I want in my theme generate menus and them put images in each menu item using the plugin Menu Image. But I can't find a hook that executes after starter content generation and executes only once. The hooks I use the content is basically in customizer changeset and I can't access them using the normal Nav Menu API of WordPress.

What I can do in this case. Someone have some idea about it? Thanks!

I'm making a Wordpress theme that generate placeholder menus using the theme support "starter content". I read the documentation and is very vague: https://make.wordpress/core/2016/11/30/starter-content-for-themes-in-4-7/.

I want in my theme generate menus and them put images in each menu item using the plugin Menu Image. But I can't find a hook that executes after starter content generation and executes only once. The hooks I use the content is basically in customizer changeset and I can't access them using the normal Nav Menu API of WordPress.

What I can do in this case. Someone have some idea about it? Thanks!

Share Improve this question edited Jun 15, 2019 at 1:09 Lucas Vendramini asked Jun 15, 2019 at 1:03 Lucas VendraminiLucas Vendramini 3032 silver badges11 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

I would start by making this part a plug-in for the theme. Then, look at all the code the source plugin provides. I am unfamiliar with this one but it looks to be ok. Find the actions and filters it introduces and use those to build your plugin. In fact I think on init you could do certainly add content.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far