WordPress Flashcards
Register/add function you created?
add_action(‘hook’,’callback_function’);
This function is used to add a menu page to your WordPress site
add_menu_page($page_title,
$menu_title,
$capability,
$menu_slag,
$function,
$icon_url,
$position);
What are the arguments of an add_menu_page() function?
First, you need a page_title, a menu_title, capability, menu_slag, callback function, icon_url, position)
3 functions used to create custom settings in WordPress
First, you need to add setting section; use * add_setting_section($id,
$title,
$callback,
$page);
- then add_setting_field($id,
$title,
$callback,
$page,
$section); - then to registered what you have done use the register_setting($section_id,$option);
OK explain how can you add function inside of functions.php of wordpress
It all starts at add_action(hook,callback);. The callback is your declared function which calls the predefined functions to add menu pages or modified a WordPress site. In functions.php you can do what you want here to modify the appearances and functions of a Wordpress site e.g. enqueuing a CSS and javascript files
use to register the function you have created
add_action(‘hook’,’callback_function’);
It is used to add menu in the menu bar
function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = ‘’, $icon_url = ‘’, $position = null);
output nonce, action, option_page fields for a setting page.(echo)
the section field should be matched on register_setting();
settings_fields(‘section’);
prints out all settings sections added to a particular settings page
do_settings_sections(‘theme-options’);
add a new sections to a settings page
add_settings_section( $id, $title, $callback, $page )
Add a new field to a section of a settings page.
function add_settings_field( $id, $title, $callback, $page, $section = ‘default’, $args = array() ) void
Register a setting and its data.
for every added field you should register it?
function register_setting( $option_group, $option_name, $args = array() ) void
show the relationship and the flow of execution of functions
https://1drv.ms/u/s!Ant-SckYa-42g88COEm16uS8vjmGRg