settings_init(); $this->settings_save(); } // END __construct() /** * Add a section to the permalinks page. * * @access public */ public function settings_init() { add_settings_section( 'attachment-permalink', __( 'Attachment Permalink', 'attachment-slug' ), array( $this, 'settings' ), 'permalink' ); } // END settings_init() /** * Clean variables using sanitize_text_field. * * @access public * @param string|array $var * @return string|array */ public function aswp_as_clean( $var ) { return is_array( $var ) ? array_map( 'aswp_as_clean', $var ) : sanitize_text_field( $var ); } // END aswp_as_clean() /** * Show the settings. * * @access public */ public function settings() { echo wpautop( __( 'These settings control the permalink used specifically for attachments.', 'attachment-slug' ) ); $attachment_permalink = get_option( 'attachment_permalink' ); $base_slug = apply_filters( 'aswp_as_base_slug', 'image' ); $structures = array( 0 => '', 1 => '/' . trailingslashit( $base_slug ), ); ?>
/?attachment=1 /sample-attachment/ |
|
//sample-attachment/ |
|
| must be set or WordPress will use default instead.', 'attachment-slug' ); ?> |