This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get associative array of sample results for keywords | |
* | |
* @param string $existing_keywords | |
* | |
* @param int $post_id | |
* | |
* @return array | |
*/ | |
public function get_samples( $existing_keywords = '', $post_id = 0 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_text_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'default' => 'Lorem Ipsum', | |
'sanitize_callback' => 'sanitize_text_field', | |
) ); | |
$wp_customize->add_control( 'themeslug_text_setting_id', array( | |
'type' => 'text', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Text' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_dropdownpages_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_dropdown_pages', | |
) ); | |
$wp_customize->add_control( 'themeslug_dropdownpages_setting_id', array( | |
'type' => 'dropdown-pages', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Dropdown Pages' ), | |
'description' => __( 'This is a custom dropdown pages option.' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_textarea_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'default' => 'Lorem Ipsum Dolor Sit amet', | |
'sanitize_callback' => 'sanitize_textarea_field', | |
) ); | |
$wp_customize->add_control( 'themeslug_textarea_setting_id', array( | |
'type' => 'textarea', | |
'section' => 'custom_section', // // Add a default or your own section | |
'label' => __( 'Custom Text Area' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themecheck_checkbox_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_checkbox', | |
) ); | |
$wp_customize->add_control( 'themeslug_checkbox_setting_id', array( | |
'type' => 'checkbox', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Checkbox' ), | |
'description' => __( 'This is a custom checkbox input.' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_number_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_number_absint', | |
'default' => 1, | |
) ); | |
$wp_customize->add_control( 'themeslug_number_setting_id', array( | |
'type' => 'number', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Number' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_time_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => '', | |
'default' => 1, | |
) ); | |
$wp_customize->add_control( 'themeslug_time_setting_id', array( | |
'type' => 'time', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Time' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Uploads an image from remote url and sets as featured image of the new post | |
* | |
* @param int $post_id The id of the new post | |
* @param string $thumbnail_url Url of the preview image hosted by BrightTalk | |
*/ | |
private function image_handler( $post_id, $thumbnail_url ) { | |
$image_url = $thumbnail_url; // Define the image URL here | |
$image_name = basename( $thumbnail_url ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wp_customize->add_setting( 'themeslug_media_setting_id', array( | |
'sanitize_callback' => 'absint', | |
'validate_callback' => 'themeslug_validate_image, | |
) ); | |
$wp_customize->add_control( | |
new WP_Customize_Media_Control( $wp_customize, 'themeslug_media_setting_id', array( | |
'label' => __( 'Custom Core Media Setting' ), | |
'section' => 'custom_section', // Add a default or your own section | |
'mime_type' => 'image', |
NewerOlder