0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; if ( !strpos( $wp_rewrite->get_page_permastruct(), $aaetp_extension ) ) { $wp_rewrite->page_structure = $wp_rewrite->page_structure . $aaetp_extension; $wp_rewrite->flush_rules(); } } } register_activation_hook( __FILE__, 'aaetp_activate' ); function aaetp_deactivate() { global $wp_rewrite; if ( ! current_user_can( 'activate_plugins' ) ) { return; } $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : ''; check_admin_referer( "deactivate-plugin_{$plugin}" ); $aaetp_settings = get_option( 'aaetp_plugin_settings' ); if ( isset ( $aaetp_settings['aaetp_extension'] ) && strlen( trim( $aaetp_settings['aaetp_extension'] ) ) > 0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; $wp_rewrite->page_structure = str_replace( $aaetp_extension, '', $wp_rewrite->page_structure ); $wp_rewrite->flush_rules(); } } register_deactivation_hook( __FILE__, 'aaetp_deactivate' ); /* function aaetp_uninstall() { if ( ! current_user_can( 'activate_plugins' ) ) { return; } check_admin_referer( 'add-any-extension-to-pages' ); if ( __FILE__ != WP_UNINSTALL_PLUGIN ) { return; } exit( var_dump( $_GET ) ); } register_uninstall_hook(__FILE__, 'aaetp_uninstall' ); */ function aaetp_permalink_with_extension() { global $wp_rewrite; $aaetp_settings = get_option( 'aaetp_plugin_settings' ); if ( isset ( $aaetp_settings['aaetp_extension'] ) && strlen( trim( $aaetp_settings['aaetp_extension'] ) ) > 0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; if ( !strpos( $wp_rewrite->get_page_permastruct(), $aaetp_extension ) ) { $wp_rewrite->page_structure = $wp_rewrite->page_structure . $aaetp_extension; } } } add_action( 'init', 'aaetp_permalink_with_extension', -1 ); function aaetp_no_page_trailing_slash($string, $type) { global $wp_rewrite; if ( $wp_rewrite->using_permalinks() && $wp_rewrite->use_trailing_slashes == true && $type == 'page' ){ return untrailingslashit( $string ); } else { return $string; } } add_filter( 'user_trailingslashit', 'aaetp_no_page_trailing_slash', 66, 2 ); function aaetp_plugin_meta( $links, $file ) { // add some links to plugin meta row if ( strpos( $file, 'add-any-extension-to-pages.php' ) !== false ) { $links = array_merge( $links, array( 'Settings' ) ); } return $links; } add_filter( 'plugin_row_meta', 'aaetp_plugin_meta', 10, 2 ); /* * Add a submenu under Tools */ function aaetp_add_pages() { $page = add_submenu_page( 'options-general.php', 'Add Any Extension to Pages', 'Add Any Extension to Pages', 'activate_plugins', 'add-any-extension-to-pages', 'aaetp_options_page' ); add_action( "admin_print_scripts-$page", "aaetp_admin_scripts" ); } add_action( 'admin_menu', 'aaetp_add_pages' ); function aaetp_admin_scripts() { wp_enqueue_style( 'aaetp_styles', plugins_url() . '/add-any-extension-to-pages/css/aaetp.css' ); } function aaetp_options_page() { global $wp_rewrite; if ( isset( $_POST['setup-update'] ) ) { unset( $_POST['setup-update'] ); update_option( 'aaetp_plugin_settings', $_POST ); echo '
Options Updated
'; echo 'Type in an extension starting with a period (.) and save.
Currently your permalink structure, including any extension you've specified, is permalink_structure; ?>. Make sure the extension below matches the extension on the Permalinks page.
This plugin allows you to specify an extension for pages.
Your best bet is to post on the plugin support page.
Please consider supporting me by rating this plugin. Thanks!