$tab_name ) : ?>

"return confirm('{$confirm}');", ) ); ?>


esc_html__( 'Third Party', 'add-to-all' ), 'head' => esc_html__( 'Header', 'add-to-all' ), 'content' => esc_html__( 'Content', 'add-to-all' ), 'footer' => esc_html__( 'Footer', 'add-to-all' ), 'feed' => esc_html__( 'Feed', 'add-to-all' ), ); /** * Filter the array containing the settings' sections. * * @since 1.2.0 * * @param array $ata_settings_sections Settings array */ return apply_filters( 'ata_settings_sections', $ata_settings_sections ); } /** * Miscellaneous callback funcion * * @since 1.2.0 * * @param array $args Arguments array. * @return void */ function ata_missing_callback( $args ) { /* translators: 1: Code. */ printf( esc_html__( 'The callback function used for the %1$s setting is missing.', 'add-to-all' ), '' . esc_attr( $args['id'] ) . '' ); } /** * Header Callback * * Renders the header. * * @since 1.2.0 * * @param array $args Arguments passed by the setting. * @return void */ function ata_header_callback( $args ) { $html = '

' . wp_kses_post( $args['desc'] ) . '

'; /** * After Settings Output filter * * @since 1.2.0 * @param string $html HTML string. * @param array Arguments array. */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Display text fields. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_text_callback( $args ) { // First, we read the options collection. global $ata_settings; if ( isset( $ata_settings[ $args['id'] ] ) ) { $value = $ata_settings[ $args['id'] ]; } else { $value = isset( $args['options'] ) ? $args['options'] : ''; } $size = sanitize_html_class( ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular' ); $class = sanitize_html_class( $args['field_class'] ); $disabled = ! empty( $args['disabled'] ) ? ' disabled="disabled"' : ''; $readonly = ( isset( $args['readonly'] ) && true === $args['readonly'] ) ? ' readonly="readonly"' : ''; $attributes = $disabled . $readonly; foreach ( (array) $args['field_attributes'] as $attribute => $val ) { $attributes .= sprintf( ' %1$s="%2$s"', $attribute, esc_attr( $val ) ); } $html = sprintf( '', sanitize_key( $args['id'] ), $class . ' ' . $size . '-text', esc_attr( stripslashes( $value ) ), $attributes ); $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Display csv fields. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_csv_callback( $args ) { ata_text_callback( $args ); } /** * Display numbercsv fields. * * @since 1.3.0 * * @param array $args Array of arguments. * @return void */ function ata_numbercsv_callback( $args ) { ata_text_callback( $args ); } /** * Display textarea. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_textarea_callback( $args ) { // First, we read the options collection. global $ata_settings; if ( isset( $ata_settings[ $args['id'] ] ) ) { $value = $ata_settings[ $args['id'] ]; } else { $value = isset( $args['options'] ) ? $args['options'] : ''; } $html = sprintf( '', sanitize_key( $args['id'] ), esc_textarea( stripslashes( $value ) ) ); $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Display CSS fields. * * @since 1.3.0 * * @param array $args Array of arguments. * @return void */ function ata_css_callback( $args ) { ata_textarea_callback( $args ); } /** * Display checboxes. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_checkbox_callback( $args ) { // First, we read the options collection. global $ata_settings; $checked = isset( $ata_settings[ $args['id'] ] ) ? checked( 1, $ata_settings[ $args['id'] ], false ) : ''; $checked = ! empty( $ata_settings[ $args['id'] ] ) ? checked( 1, $ata_settings[ $args['id'] ], false ) : ''; $default = isset( $args['options'] ) ? $args['options'] : ''; $set = isset( $ata_settings[ $args['id'] ] ) ? $ata_settings[ $args['id'] ] : ''; $html = sprintf( '', sanitize_key( $args['id'] ) ); $html .= sprintf( '', sanitize_key( $args['id'] ), $checked ); $html .= ( $set <> $default ) ? ' ' . esc_html__( 'Modified from default setting', 'add-to-all' ) . '' : ''; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Multicheck Callback * * Renders multiple checkboxes. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_multicheck_callback( $args ) { global $ata_settings; $html = ''; if ( ! empty( $args['options'] ) ) { $html .= sprintf( '', $args['id'] ); foreach ( $args['options'] as $key => $option ) { if ( isset( $ata_settings[ $args['id'] ][ $key ] ) ) { $enabled = $key; } else { $enabled = null; } $html .= sprintf( ' ', sanitize_key( $args['id'] ), sanitize_key( $key ), esc_attr( $key ), checked( $key, $enabled, false ) ); $html .= sprintf( '
', sanitize_key( $args['id'] ), sanitize_key( $key ), $option ); } $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; } /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Radio Callback * * Renders radio boxes. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_radio_callback( $args ) { global $ata_settings; $html = ''; foreach ( $args['options'] as $option ) { $checked = false; if ( isset( $ata_settings[ $args['id'] ] ) && $ata_settings[ $args['id'] ] === $option['id'] ) { $checked = true; } elseif ( isset( $args['default'] ) && $args['default'] === $option['id'] && ! isset( $ata_settings[ $args['id'] ] ) ) { $checked = true; } $html .= sprintf( ' ', sanitize_key( $args['id'] ), $option['id'], checked( true, $checked, false ) ); $html .= sprintf( '', sanitize_key( $args['id'] ), $option['id'], $option['name'] ); $html .= ': ' . wp_kses_post( $option['description'] ) . '
'; } $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Radio callback with description. * * Renders radio boxes with each item having it separate description. * * @since 1.3.0 * * @param array $args Array of arguments. * @return void */ function ata_radiodesc_callback( $args ) { global $ata_settings; $html = ''; foreach ( $args['options'] as $option ) { $checked = false; if ( isset( $ata_settings[ $args['id'] ] ) && $ata_settings[ $args['id'] ] === $option['id'] ) { $checked = true; } elseif ( isset( $args['default'] ) && $args['default'] === $option['id'] && ! isset( $ata_settings[ $args['id'] ] ) ) { $checked = true; } $html .= sprintf( ' ', sanitize_key( $args['id'] ), $option['id'], checked( true, $checked, false ) ); $html .= sprintf( '', sanitize_key( $args['id'] ), $option['id'], $option['name'] ); $html .= ': ' . wp_kses_post( $option['description'] ) . '
'; } $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Number Callback * * Renders number fields. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_number_callback( $args ) { global $ata_settings; if ( isset( $ata_settings[ $args['id'] ] ) ) { $value = $ata_settings[ $args['id'] ]; } else { $value = isset( $args['options'] ) ? $args['options'] : ''; } $max = isset( $args['max'] ) ? $args['max'] : 999999; $min = isset( $args['min'] ) ? $args['min'] : 0; $step = isset( $args['step'] ) ? $args['step'] : 1; $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; $html = sprintf( '', esc_attr( $step ), esc_attr( $max ), esc_attr( $min ), sanitize_html_class( $size ) . '-text', sanitize_key( $args['id'] ), esc_attr( stripslashes( $value ) ) ); $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Select Callback * * Renders select fields. * * @since 1.2.0 * * @param array $args Array of arguments. * @return void */ function ata_select_callback( $args ) { global $ata_settings; if ( isset( $ata_settings[ $args['id'] ] ) ) { $value = $ata_settings[ $args['id'] ]; } else { $value = isset( $args['default'] ) ? $args['default'] : ''; } if ( isset( $args['chosen'] ) ) { $chosen = 'class="ata-chosen"'; } else { $chosen = ''; } $html = sprintf( ''; $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Descriptive text callback. * * Renders descriptive text onto the settings field. * * @since 2.2.0 * * @param array $args Array of arguments. * @return void */ function ata_descriptive_text_callback( $args ) { $html = '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Display csv fields. * * @since 2.2.0 * * @param array $args Array of arguments. * @return void */ function ata_posttypes_callback( $args ) { global $ata_settings; $html = ''; if ( isset( $ata_settings[ $args['id'] ] ) ) { $options = $ata_settings[ $args['id'] ]; } else { $options = isset( $args['options'] ) ? $args['options'] : ''; } // If post_types is empty or contains a query string then use parse_str else consider it comma-separated. if ( is_array( $options ) ) { $post_types = $options; } elseif ( ! is_array( $options ) && false === strpos( $options, '=' ) ) { $post_types = explode( ',', $options ); } else { parse_str( $options, $post_types ); } $wp_post_types = get_post_types( array( 'public' => true, ) ); $posts_types_inc = array_intersect( $wp_post_types, $post_types ); foreach ( $wp_post_types as $wp_post_type ) { $html .= sprintf( ' ', sanitize_key( $args['id'] ), esc_attr( $wp_post_type ), checked( true, in_array( $wp_post_type, $posts_types_inc, true ), false ) ); $html .= sprintf( '
', sanitize_key( $args['id'] ), $wp_post_type ); } $html .= '

' . wp_kses_post( $args['desc'] ) . '

'; /** This filter has been defined in settings-page.php */ echo apply_filters( 'ata_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped }