You’re actually calling the add_meta_box()
function before it’s defined, when you run this directly:
\ci\wp\Metaboxes::addMetabox(
'front_page_slide_settings',
'Slide settings',
'page',
'normal',
'high'
);
You don’t mention where you run it, but it’s too early or you run it in the front-end, where add_meta_box()
is not defined.
The add_meta_box()
function is defined within this file:
/** WordPress Template Administration API */
require_once(ABSPATH . 'wp-admin/includes/template.php');
Make sure to run your problematic snippet afterwards, e.g. within the add_meta_boxes
action, like you do within the Metaboxes::init()
call.
The core init
action, as an example, fires before that Template Administration API is loaded.
Related Posts:
- get_template_part vs action hooks in themes
- after_setup_theme always runs
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- Getting instance variable in scope of ‘wp_enqueue_scripts’
- What is a good way to pass a variable from add_action to a Theme?
- Theme elements not translating
- What’s the best action to use when you want to do something only once per theme setup?
- How to write .htaccess dynamically? [closed]
- Use debugging for add action events
- after_setup_theme, Global Variable and Theme Customizer
- Is there an action for save_menu and/or update_menu?
- How to make content editable from admin page?
- Does the switch_theme action run when you’re upgrading a theme?
- WordPress taxonomy and archive custom class
- Replace function in a child theme
- save_post action doesn’t passing post id to my function as argument
- Overide enqueue in non plugable function via child theme
- Never actually adding the action? Or do I have to call the action?
- Add content after get_header
- How to make a function occurs for one time?
- Suppress the_content filter in a nested loop
- add_action not working in header?
- Is there a way to prevent wp_head from outputting self-closing tags?
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- Theme’s featured image option is not showing up
- Add text when displying attribute with a hook on single product page
- When to use _e and __ for the translation?
- With WordPress themes, where do I store the images and files relatively?
- Should `get_template_directory_uri()` be escaped?
- How to Include SVG sprites icons into the body tag? [closed]
- Why doesn’t /2013/01/ properly return January’s archives in archive.php?
- Child Theme not loading parent CSS
- Removing all classes from nav_menu except current-menu-item and current-menu-parent
- Best practice for including plugins as part of a theme?
- Adding dashicon fonts to the admin of pre 3.8 installs
- query posts in wordpress
- wp_enqueue_scripts not called on search page?
- How to use bloginfo( ‘template_directory’ ) in array
- Prevent WordPress updates from overriding custom language translations?
- Add tinymce to widget textareas
- Custom Nav Walker to show siblings and children of current branch?
- Page template across themes
- Append HTML to an LI of wp_list_categories
- Customizer API and add_panel(). Panel doesn’t show
- Child themes: disabling the parent
- Is there a filter for enqueue script to strip the type=”text/javascript” property
- How display id of most recent modified post in wordpress?
- Should I use function_exists() and/or add_action() in theme development?
- Bold letters inside excerpt [closed]
- How to make Home Menu( Front Page) use index.php instead of page.php
- JavaScript Change focus to password field login page being reset
- Using esc_url with a hard coded url
- Broken template went invisible
- How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor
- Custom Nav Walker Trouble
- How to make permalinks update from code?
- Post thumbnail to append post content via ajax click event
- Custom WordPress File Inclusion
- WordPress 3.8 Backend Admin Color Scheme add more scheme how to do?
- How to do a section of bulleted text within our page?
- What should I use? index.php, front-page.php and home.php
- Theme thumbnail in dashboard
- How to change the theme directory uri for localhost?
- What is the diferences between pure WordPress theme and Woocommerce theme? [closed]
- featured content: which area does this cover [closed]
- How to count posts of a category and of a category limited by a tag
- Insert Rich Text Editor in theme?
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- Different themes on one site
- Theme Check errors of theme code
- Allow different tags in widget titles
- Pagination and multiple loops
- Does wordpress add their own classes into nav menus?
- Post archives link yields a 404 Not Found
- Getting white screen of death on category pages because of body_class() function
- Let user to upload multiple time
- Developing WordPress site behind a static site
- Code showing in wordpress post titles around website
- register_theme_directory() sees custom themes directory, but blank frontend
- How to change parent permalink?
- how to call options on front end and add logo
- Jetpack Infinite Scroll Not Working
- Editable screenshot.png in a custom theme developed
- How to create multiple pages in a client theme?
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- Duplicate WordPress site to subdirectory but use same db?
- Menu order of parent menu from perspective of child menu
- Conditional loop based on current page
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- wp_deregister_script was called incorrectly
- Multiple Content Shortcodes
- Add the ability of changing background color of a theme [closed]
- How to use esc_attr__() function properly to translate a variable that contains string?
- Permalinks problem with custom theme
- Purchased Theme to Custom Made Theme? [closed]
- How to make website with many template that active [closed]
- Query for tag given slug
- Bootstrap 4 mobile menu not working for WordPress Development
- How do I send out an update for my custom wordpress theme?