apply_filters( 'ata_settings_third_party', array( 'statcounter_header' => array( 'id' => 'statcounter_header', 'name' => '
Tynt.push('ID HERE')" ),
'type' => 'text',
'options' => '',
),
'verification_header' => array(
'id' => 'verification_header',
'name' => 'wp_head()' ),
'type' => 'textarea',
'options' => '',
),
)
),
/*** Content settings */
'content' => apply_filters(
'ata_settings_content',
array(
'content_filter_priority' => array(
'id' => 'content_filter_priority',
'name' => esc_html__( 'Content filter priority', 'add-to-all' ),
'desc' => esc_html__( 'A higher number will cause the Add to All output to be processed after other filters. Number below 10 is not recommended.', 'add-to-all' ),
'type' => 'text',
'options' => 999,
),
'exclude_on_post_ids' => array(
'id' => 'exclude_on_post_ids',
'name' => esc_html__( 'Exclude display on these post IDs', 'add-to-all' ),
'desc' => esc_html__( 'Comma-separated list of post or page IDs to exclude displaying the above content. e.g. 188,320,500', 'add-to-all' ),
'type' => 'numbercsv',
'options' => '',
),
'content_process_shortcode' => array(
'id' => 'content_process_shortcode',
'name' => esc_html__( 'Process shortcodes in content', 'add-to-all' ),
'desc' => esc_html__( 'Check this box to execute any shortcodes that you enter in the options below.', 'add-to-all' ),
'type' => 'checkbox',
'options' => false,
),
'content_header_all' => array(
'id' => 'content_header_all',
'name' => 'wp_footer()' ),
'type' => 'textarea',
'options' => '',
),
)
),
/*** Feed settings */
'feed' => apply_filters(
'ata_settings_feed',
array(
'feed_add_copyright' => array(
'id' => 'feed_add_copyright',
'name' => esc_html__( 'Add copyright notice?', 'add-to-all' ),
'desc' => esc_html__( 'Check this to add the below copyright notice to your feed.', 'add-to-all' ),
'type' => 'checkbox',
'options' => true,
),
'feed_copyrightnotice' => array(
'id' => 'feed_copyrightnotice',
'name' => esc_html__( 'Coyright text', 'add-to-all' ),
'desc' => esc_html__( 'Enter valid HTML only. This copyright notice is added as the last item of your feed.', 'add-to-all' ),
'type' => 'textarea',
'options' => ata_get_copyright_text(),
),
'feed_add_title' => array(
'id' => 'feed_add_title',
'name' => esc_html__( 'Add post title?', 'add-to-all' ),
'desc' => esc_html__( 'Add a link to the title of the post in the feed.', 'add-to-all' ),
'type' => 'checkbox',
'options' => true,
),
'feed_title_text' => array(
'id' => 'feed_title_text',
'name' => esc_html__( 'Title text', 'add-to-all' ),
/* translators: No strings here. */
'desc' => esc_html__( 'The above text will be added to the feed. You can use %title% to add a link to the post, %date% and %time% to display the date and time of the post respectively.', 'add-to-all' ),
'type' => 'textarea',
/* translators: No strings here. */
'options' => esc_html__( '%title% was first posted on %date% at %time%.', 'add-to-all' ),
),
'feed_process_shortcode' => array(
'id' => 'feed_process_shortcode',
'name' => esc_html__( 'Process shortcodes in feed', 'add-to-all' ),
'desc' => esc_html__( 'Check this box to execute any shortcodes that you enter in the options below.', 'add-to-all' ),
'type' => 'checkbox',
'options' => false,
),
'feed_add_html_before' => array(
'id' => 'feed_add_html_before',
'name' => esc_html__( 'Add HTML before content?', 'add-to-all' ),
'desc' => esc_html__( 'Check this to add the HTML below before the content of your post.', 'add-to-all' ),
'type' => 'checkbox',
'options' => false,
),
'feed_html_before' => array(
'id' => 'feed_html_before',
'name' => esc_html__( 'HTML to add before the content', 'add-to-all' ),
'desc' => esc_html__( 'Enter valid HTML or JavaScript (wrapped in script tags). No PHP allowed.', 'add-to-all' ),
'type' => 'textarea',
'options' => '',
),
'feed_add_html_after' => array(
'id' => 'feed_add_html_after',
'name' => esc_html__( 'Add HTML after content?', 'add-to-all' ),
'desc' => esc_html__( 'Check this to add the HTML below before the content of your post.', 'add-to-all' ),
'type' => 'checkbox',
'options' => false,
),
'feed_html_after' => array(
'id' => 'feed_html_after',
'name' => esc_html__( 'HTML to add after the content', 'add-to-all' ),
'desc' => esc_html__( 'Enter valid HTML or JavaScript (wrapped in script tags). No PHP allowed.', 'add-to-all' ),
'type' => 'textarea',
'options' => '',
),
'add_credit' => array(
'id' => 'add_credit',
'name' => esc_html__( 'Add a link to "Add to All" plugin page', 'add-to-all' ),
'desc' => '',
'type' => 'checkbox',
'options' => false,
),
)
),
);
/**
* Filters the settings array
*
* @since 1.2.0
*
* @param array $ata_setings Settings array
*/
return apply_filters( 'ata_registered_settings', $ata_settings );
}
/**
* Copyright notice text.
*
* @since 1.2.0
* @return string Copyright notice
*/
function ata_get_copyright_text() {
$copyrightnotice = '©' . date( 'Y' ) . ' "' . get_option( 'blogname' ) . '". ';
$copyrightnotice .= esc_html__( 'Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at ', 'ald_ata_plugin' );
$copyrightnotice .= '' . get_option( 'admin_email' ) . '';
/**
* Copyright notice text.
*
* @since 1.2.0
* @param string $copyrightnotice Copyright notice
*/
return apply_filters( 'ata_copyright_text', $copyrightnotice );
}
/**
* Upgrade v1.1.0 settings to v1.2.0.
*
* @since v1.2.0
* @return array Settings array
*/
function ata_upgrade_settings() {
$old_settings = get_option( 'ald_ata_settings' );
if ( empty( $old_settings ) ) {
return false;
} else {
$map = array(
'add_credit' => 'addcredit',
// Content options.
'content_html_before' => 'content_htmlbefore',
'content_html_after' => 'content_htmlafter',
'content_add_html_before' => 'content_addhtmlbefore',
'content_add_html_after' => 'content_addhtmlafter',
'content_html_before_single' => 'content_htmlbeforeS',
'content_html_after_single' => 'content_htmlafterS',
'content_add_html_before_single' => 'content_addhtmlbeforeS',
'content_add_html_after_single' => 'content_addhtmlafterS',
'content_filter_priority' => 'content_filter_priority',
// Feed options.
'feed_html_before' => 'feed_htmlbefore',
'feed_html_after' => 'feed_htmlafter',
'feed_add_html_before' => 'feed_addhtmlbefore',
'feed_add_html_after' => 'feed_addhtmlafter',
'feed_copyrightnotice' => 'feed_copyrightnotice',
'feed_add_title' => 'feed_addtitle',
'feed_title_text' => 'feed_titletext',
'feed_add_copyright' => 'feed_addcopyright',
// 3rd party options.
'sc_project' => 'tp_sc_project',
'sc_security' => 'tp_sc_security',
'ga_uacct' => 'tp_ga_uacct',
'tynt_id' => 'tp_tynt_id',
// Footer options.
'footer_other_html' => 'ft_other',
// Header options.
'head_css' => 'head_CSS',
'head_other_html' => 'head_other',
);
foreach ( $map as $key => $value ) {
$settings[ $key ] = strval( $old_settings[ $value ] );
}
delete_option( 'ald_ata_settings' );
return $settings;
}
}