ﺕﺎﻓﺎﺿﻹﺍﻭ ﺔﻴﻋﺮﻔﻟﺍ ﺕﺎﻤﺴﻟﺍﻭ ﺔﻴﻃﺮﺸﻟﺍ ﻁﻭﺮﺸﻟﺍ :ﺕﺎﻤﺴﻟﺍ ﺺﻴﺼﺨﺗ ﺓﺍﺩﺃ
- WordPress ﺕﺎﻤﺳ ﺺﻴﺼﺨﺗ ﺓﺍﺩﺃ ﻰﻟﺇ ﺔﻣﺪﻘﻣ .1<ﻥﺎﺒﺳ>
- WordPress ﺕﺎﻤﺳ ﺺﻴﺼﺨﺗ ﺓﺍﺩﺃ ﻊﻣ ﻞﻋﺎﻔﺘﻟﺍ .2<ﻥﺎﺒﺳ>
- WordPress ﻉﻮﺿﻮﻤﻟ ﺺﺼﺨﻣُ ﺐﻟﺎﻗ .3<ﻥﺎﺒﺳ>
- WordPress ﻉﻮﺿﻮﻤﻟ ﺺﺼﺨﻤﻟﺍ WordPress ﺐﻟﺎﻗ ﻊﻴﺳﻮﺗ .4<ﻥﺎﺒﺳ>
- 5. ﺎﻴًﻟﺎﺣ ﺓءﺍﺮﻘﻟﺍ: ﺔﻴﻓﺎﺿﻹﺍ ﺕﺎﻧﻮﻜﻤﻟﺍﻭ ﺔﻴﻋﺮﻔﻟﺍ ﺕﺎﻤﺴﻟﺍﻭ ﺔﻴ
.ﻚﺒﻟﺎﻗ ﻲﻓ ﺎﻬﻣﺍﺪﺨﺘﺳﺍ ﺪﻳﺮﺗ ﻲﺘﻟﺍ ﺕﺍﺭﺎﻴﺨﻟﺍ ﻦﻣ ﺔﻋﻮﻤﺠﻣ ﺮﻳﺮﻤﺗﻭ ‘thsp_cbp_opti
:add_filter ﺔﻔﻴﻇﻭ ﻡﺍﺪﺨﺘﺳﺎﺑ ﺩﻮﺟﻮﻣ ﺢﺷﺮﻤﺑ ﺎﻬﻄﺑﺭﻭ ﺔﺼﺼﺨﻤﻟﺍ ﻚﺘﻔﻴﻇﻭ ﺪﻳﺪﺤﺗ ﻚﻨﻜﻤﻳ .(ﻝﺎﺜ
add_filter( $tag, $function_to_add, $priority, $accepted_args );
:ﺍﺬﻫ ﻞﺜﻣ ءﻲﺸﺑ ﺖﻤﻗ ﺍﺫﺇ ﻚﻟﺬﻟ .ﻚﺘﻔﻴﻇﻭ ﺬﻴﻔﻨﺗ ﻢﺘﻳ ﻖﺑﺎﺳ ﺖﻗﻭ ﻲﻓ ،ﻢﻗﺮﻟﺍ ﺾﻔﺧ .ﻚﺘﻔﻴﻇﻭ ﺬﻴ
// Adding first message
function my_theme_add_first_message( $content ) {
$content .= '<p>First Message</p>';
return $content;
}
add_filter( 'the_content', 'my_theme_add_first_message', 1 );
// Adding second message
function my_theme_add_second_message( $content ) {
$content .= '<p>Second Message</p>';
return $content;
}
add_filter( 'the_content', 'my_theme_add_second_message', 2 );
.ﺎﻬﻘﻳﺮﻃ ﻲﻓ ءﺎﻴﺷﻷﺍ ﻉﺍﻮﻧﺃ ﻞﻛ ﻂﻘﺘﻠﺗﻭ ﻞﺘﻟﺍ ﻞﻔﺳﺃ ﺝﺮﺣﺪﺘﺗ ﺞﻠﺛ ﺕﺍﺮﻛ ﺖﻧﺎﻛ ﻮﻟ ﺎﻤﻛ ﺕﺎﻓﺎﻄﺨ
؟Theme Customizer Boilerplate ﻰﻠﻋ ﺍﺬﻫ ﻖﺒﻄﻨﻳ ﻒﻴﻛ
:ﻝﺎﺜﻤﻟﺍ ﺍﺬﻫ ﻰﻠﻋ ﺓﺮﻈﻧ ﻖﻟﺍ .ﻞﻌﻔﻟﺎﺑ ﺎﻬﺗﺩﺪﺣ ﻲﺘﻟﺍ my_theme_options_array ﺔﻔﻴﻇﻭ ﺪﻌﺑ
function my_theme_options_array() {
// Using helper function to get default required capability
$thsp_cbp_capability = thsp_cbp_capability();
$options = array(
// Section ID
'my_theme_new_section' => array(
'existing_section' => false,
'args' => array(
'title' => __( 'New Section', 'my_theme_textdomain' ),
'priority' => 10
),
'fields' => array(
/*
* Radio field
*/
'my_radio_button' => array(
'setting_args' => array(
'default' => 'option-2',
'type' => 'option',
'capability' => $thsp_cbp_capability,
'transport' => 'refresh',
),
'control_args' => array(
'label' => __( 'My Radio Button', 'my_theme_textdomain' ),
'type' => 'radio', // Radio control
'choices' => array(
'option-1' => array(
'label' => __( 'Option 1', 'my_theme_textdomain' )
),
'option-2' => array(
'label' => __( 'Option 2', 'my_theme_textdomain' )
),
'option-3' => array(
'label' => __( 'Option 3', 'my_theme_textdomain' )
)
),
'priority' => 3
)
)
)
)
);
return $options;
}
add_filter( 'thsp_cbp_options_array', 'my_theme_options_array', 1 );
:ﻞﻬﺳ .ﻲﺑ ﺹﺎﺨﻟﺍ ﺭﺎﻴﺘﺧﻻﺍ ﻊﺑﺮﻣ ﻚﻳﺪﻟ ﻥﻮﻜﻳ ﻥﺃ ﻞﻀﻓﻷﺍ ﻦﻣ ﻥﻮﻜﻳ ﺪﻗ ،ﻲﺑ ﺹﺎﺨﻟﺍ ﺭﺎﻴﺘﺧﻻﺍ ﺭﺯ
function my_child_theme_options_array( $options ) {
// Using helper function to get default required capability
$thsp_cbp_capability = thsp_cbp_capability();
/*
* This time, we're only editing fields in my_theme_new_section in the $options array
*/
$options['my_theme_new_section']['fields'] = array(
'my_checkbox_field' => array(
'setting_args' => array(
'default' => true,
'type' => 'option',
'capability' => $thsp_cbp_capability,
'transport' => 'refresh',
),
'control_args' => array(
'label' => __( 'My Checkbox', 'my_theme_textdomain' ),
'type' => 'checkbox', // Checkbox field control
'priority' => 2
)
)
);
return $options;
}
add_filter( 'thsp_cbp_options_array', 'my_child_theme_options_array', 2 );
.ﺎﻬﻠﻤﻛﺄﺑ options$ﺔﻓﻮﻔﺼﻣ ﺲﻴﻟﻭ ،options['my_theme_new_section'] ['fields']$ـﺑ
:ﻞﻬﺳ ،ﻯﺮﺧﺃ ﺓﺮﻣ .ﺎﻄًﺸﻧ ﻦﻴﻌﻣ ﻲﻓﺎﺿﺇ ﻥﻮﻜﻣ ﻥﺎﻛ ﺍﺫﺇ ﻂﻘﻓ ﺕﺎﻤﺴﻟﺍ ﺺﻴﺼﺨﺗ ﺓﺍﺩﺃ ﺕﺍﺭﺎﻴﺧ ﺾﻌﺑ
function my_plugin_dependency_options_array( $options ) {
// Using helper function to get default required capability
$thsp_cbp_capability = thsp_cbp_capability();
/*
* Only adding my_plugin_dependency_section if 'test-plugin.php' is active
*/
if ( is_plugin_active( 'test-plugin/test-plugin.php' ) ) {
$options['my_plugin_dependency_section'] = array(
'existing_section' => false,
'args' => array(
'title' => __( 'Plugin Dependency', 'my_theme_textdomain' ),
'priority' => 10
),
'fields' => array(
/*
* Text field
*/
// Field ID
'new_text_field' => array(
'setting_args' => array(
'default' => __( '', 'my_theme_textdomain' ),
'type' => 'option',
'capability' => $thsp_cbp_capability,
'transport' => 'refresh',
),
'control_args' => array(
'label' => __( 'Only shows if', 'my_theme_textdomain' ),
'type' => 'text', // Text field control
'priority' => 5
)
),
)
);
}
return $options;
}
add_filter( 'thsp_cbp_options_array', 'my_plugin_dependency_options_array', 3 );
.ﺐﻟﺎﻘﻟﺎﺑ ﺹﺎﺨﻟﺍ function.php ﻒﻠﻣ ﻦﻣ ﻚﻟﺫ ﺎﻬﺑ ﻞﻌﻔﺗ ﻲﺘﻟﺍ ﺔﻘﻳﺮﻄﻟﺍ ﺲﻔﻨﺑ ،ﺎﻀًﻳﺃ ﻲﻓﺎﺿﻹﺍ
ﻥﻮﻨﺠﻤﻟﺍ ﺭﺎﻴﺨﻟﺍ ﻰﻟﺇ ﺐﻫﺬﺗ ﻻ
.ﻥﺎﻜﻣﻹﺍ ﺭﺪﻗ ﻚﺑ ﺹﺎﺨﻟﺍ ﺐﻟﺎﻘﻟﺍ ﺕﺍﺭﺎﻴﺧ ﺩﺪﻋ ﻞﻴﻠﻘﺗ ﻲﻓ ،ﺔﻴﻓﺎﺿﻹﺍ ﺕﺎﻧﻮﻜﻤﻟﺍ ﻰﻠﻋ ﺓﺪﻤﺘﻌﻤﻟﺍ
.ﺎﻌًﺋﺍﺭ ﺍﺭًﺮﺤﻣ ﺲﻴﻟ ﺎﻤﺑﺭﻭ WYSIWYG ﺭﺮﺤﻣ ﻪﻨﻜﻟﻭ ﺎﺒًﻟﺎﻗ ﺲﻴﻟ ﻮﻬﻓ ،ﺓﺪﺣ ﻰﻠﻋ ﺮﺼﻨﻋ ﻞﻜﻟ ﺩﻭﺪﺣ
.ﻲﻐﺒﻨﻳ ﺎﻤﻛ ﻲﻫ ﻡﺪﺨﺘﺴﻤﻟﺍ ﺕﺎﻌﻗﻮﺗ ﻥﺃ ﻦﻣ ﺪﻛﺄﺘﻟﺍ ﻚﺒﺟﺍﻭ ﻦﻤﻓ ،ﺐﻟﺍﻮﻘﻠﻟ ﺍﺭًﻮﻄﻣ ﺖﻨﻛ ﺍﺫﺇ .ﺎ