WordPress Flashcards

1
Q

Register/add function you created?

A

add_action(‘hook’,’callback_function’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

This function is used to add a menu page to your WordPress site

A

add_menu_page($page_title,
$menu_title,
$capability,
$menu_slag,
$function,
$icon_url,
$position);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the arguments of an add_menu_page() function?

A

First, you need a page_title, a menu_title, capability, menu_slag, callback function, icon_url, position)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

3 functions used to create custom settings in WordPress

A

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);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

OK explain how can you add function inside of functions.php of wordpress

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

use to register the function you have created

A

add_action(‘hook’,’callback_function’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

It is used to add menu in the menu bar

A

function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = ‘’, $icon_url = ‘’, $position = null);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

output nonce, action, option_page fields for a setting page.(echo)
the section field should be matched on register_setting();

A

settings_fields(‘section’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

prints out all settings sections added to a particular settings page

A

do_settings_sections(‘theme-options’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

add a new sections to a settings page

A

add_settings_section( $id, $title, $callback, $page )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Add a new field to a section of a settings page.

A

function add_settings_field( $id, $title, $callback, $page, $section = ‘default’, $args = array() ) void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Register a setting and its data.

for every added field you should register it?

A

function register_setting( $option_group, $option_name, $args = array() ) void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

show the relationship and the flow of execution of functions

A

https://1drv.ms/u/s!Ant-SckYa-42g88COEm16uS8vjmGRg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly