set_parentage( $parent_file ); ?>
render_screen_meta(); if ( is_network_admin() ) { /** * Prints network admin screen notices. * * @since 3.1.0 */ do_action( 'network_admin_notices' ); } elseif ( is_user_admin() ) { /** * Prints user admin screen notices. * * @since 3.1.0 */ do_action( 'user_admin_notices' ); } else { /** * Prints admin screen notices. * * @since 3.1.0 */ do_action( 'admin_notices' ); } /** * Prints generic admin screen notices. * * @since 3.1.0 */ do_action( 'all_admin_notices' ); if ( 'options-general.php' === $parent_file ) { require ABSPATH . 'wp-admin/options-head.php'; } revision.php000064400000013333147177044200007124 0ustar00post_parent ) ) { break; } $post = get_post( $revision->post_parent ); if ( ! $post ) { break; } // Don't restore if revisions are disabled and this is not an autosave. if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) { $redirect = 'edit.php?post_type=' . $post->post_type; break; } // Don't restore if the post is locked. if ( wp_check_post_lock( $post->ID ) ) { break; } check_admin_referer( "restore-post_{$revision->ID}" ); /* * Ensure the global $post remains the same after revision is restored. * Because wp_insert_post() and wp_transition_post_status() are called * during the process, plugins can unexpectedly modify $post. */ $backup_global_post = clone $post; wp_restore_post_revision( $revision->ID ); // Restore the global $post as it was before. $post = $backup_global_post; $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID, ), get_edit_post_link( $post->ID, 'url' ) ); break; case 'view': case 'edit': default: $revision = wp_get_post_revision( $revision_id ); if ( ! $revision ) { break; } $post = get_post( $revision->post_parent ); if ( ! $post ) { break; } if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) ) { break; } // Bail if revisions are disabled and this is not an autosave. if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) { $redirect = 'edit.php?post_type=' . $post->post_type; break; } $post_edit_link = get_edit_post_link(); $post_title = '' . _draft_or_post_title() . ''; /* translators: %s: Post title. */ $h1 = sprintf( __( 'Compare Revisions of “%s”' ), $post_title ); $return_to_post = '' . __( '← Go to editor' ) . ''; // Used in the HTML title tag. $title = __( 'Revisions' ); $redirect = false; break; } // Empty post_type means either malformed object found, or no valid parent was found. if ( ! $redirect && empty( $post->post_type ) ) { $redirect = 'edit.php'; } if ( ! empty( $redirect ) ) { wp_redirect( $redirect ); exit; } // This is so that the correct "Edit" menu item is selected. if ( ! empty( $post->post_type ) && 'post' !== $post->post_type ) { $parent_file = 'edit.php?post_type=' . $post->post_type; } else { $parent_file = 'edit.php'; } $submenu_file = $parent_file; wp_enqueue_script( 'revisions' ); wp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id, $from ) ); /* Revisions Help Tab */ $revisions_overview = '

' . __( 'This screen is used for managing your content revisions.' ) . '

'; $revisions_overview .= '

' . __( 'Revisions are saved copies of your post or page, which are periodically created as you update your content. The red text on the left shows the content that was removed. The green text on the right shows the content that was added.' ) . '

'; $revisions_overview .= '

' . __( 'From this screen you can review, compare, and restore revisions:' ) . '

'; $revisions_overview .= '
  • ' . __( 'To navigate between revisions, drag the slider handle left or right or use the Previous or Next buttons.' ) . '
  • '; $revisions_overview .= '
  • ' . __( 'Compare two different revisions by selecting the “Compare any two revisions” box to the side.' ) . '
  • '; $revisions_overview .= '
  • ' . __( 'To restore a revision, click Restore This Revision.' ) . '
'; get_current_screen()->add_help_tab( array( 'id' => 'revisions-overview', 'title' => __( 'Overview' ), 'content' => $revisions_overview, ) ); $revisions_sidebar = '

' . __( 'For more information:' ) . '

'; $revisions_sidebar .= '

' . __( 'Revisions Management' ) . '

'; $revisions_sidebar .= '

' . __( 'Support forums' ) . '

'; get_current_screen()->set_help_sidebar( $revisions_sidebar ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

' . __( 'You need a higher level of permission.' ) . '' . '

' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '

', 403 ); } if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) { if ( 'activate' === $_GET['action'] ) { check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! $theme->exists() || ! $theme->is_allowed() ) { wp_die( '

' . __( 'Something went wrong.' ) . '

' . '

' . __( 'The requested theme does not exist.' ) . '

', 403 ); } switch_theme( $theme->get_stylesheet() ); wp_redirect( admin_url( 'themes.php?activated=true' ) ); exit; } elseif ( 'resume' === $_GET['action'] ) { check_admin_referer( 'resume-theme_' . $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! current_user_can( 'resume_theme', $_GET['stylesheet'] ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to resume this theme.' ) . '

', 403 ); } $result = resume_theme( $theme->get_stylesheet(), self_admin_url( 'themes.php?error=resuming' ) ); if ( is_wp_error( $result ) ) { wp_die( $result ); } wp_redirect( admin_url( 'themes.php?resumed=true' ) ); exit; } elseif ( 'delete' === $_GET['action'] ) { check_admin_referer( 'delete-theme_' . $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! current_user_can( 'delete_themes' ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete this item.' ) . '

', 403 ); } if ( ! $theme->exists() ) { wp_die( '

' . __( 'Something went wrong.' ) . '

' . '

' . __( 'The requested theme does not exist.' ) . '

', 403 ); } $active = wp_get_theme(); if ( $active->get( 'Template' ) === $_GET['stylesheet'] ) { wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) ); } else { delete_theme( $_GET['stylesheet'] ); wp_redirect( admin_url( 'themes.php?deleted=true' ) ); } exit; } elseif ( 'enable-auto-update' === $_GET['action'] ) { if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { wp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ) ); } check_admin_referer( 'updates' ); $all_items = wp_get_themes(); $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); $auto_updates[] = $_GET['stylesheet']; $auto_updates = array_unique( $auto_updates ); // Remove themes that have been deleted since the site option was last updated. $auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); update_site_option( 'auto_update_themes', $auto_updates ); wp_redirect( admin_url( 'themes.php?enabled-auto-update=true' ) ); exit; } elseif ( 'disable-auto-update' === $_GET['action'] ) { if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { wp_die( __( 'Sorry, you are not allowed to disable themes automatic updates.' ) ); } check_admin_referer( 'updates' ); $all_items = wp_get_themes(); $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); $auto_updates = array_diff( $auto_updates, array( $_GET['stylesheet'] ) ); // Remove themes that have been deleted since the site option was last updated. $auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); update_site_option( 'auto_update_themes', $auto_updates ); wp_redirect( admin_url( 'themes.php?disabled-auto-update=true' ) ); exit; } } // Used in the HTML title tag. $title = __( 'Themes' ); $parent_file = 'themes.php'; // Help tab: Overview. if ( current_user_can( 'switch_themes' ) ) { $help_overview = '

' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '

' . '

' . __( 'From this screen you can:' ) . '

' . '
  • ' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '
  • ' . '
  • ' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '
  • ' . '
  • ' . __( 'Click Customize for the active theme or Live Preview for any other theme to see a live preview' ) . '
' . '

' . __( 'The active theme is displayed highlighted as the first theme.' ) . '

' . '

' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' ' . __( 'The search results will be updated as you type.' ) . '

'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help_overview, ) ); } // End if 'switch_themes'. // Help tab: Adding Themes. if ( current_user_can( 'install_themes' ) ) { if ( is_multisite() ) { $help_install = '

' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '

'; } else { $help_install = '

' . sprintf( /* translators: %s: https://wordpress.org/themes/ */ __( 'If you would like to see more themes to choose from, click on the “Add New Theme” button and you will be able to browse or search for additional themes from the WordPress Theme Directory. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ), __( 'https://wordpress.org/themes/' ) ) . '

'; } get_current_screen()->add_help_tab( array( 'id' => 'adding-themes', 'title' => __( 'Adding Themes' ), 'content' => $help_install, ) ); } // End if 'install_themes'. // Help tab: Previewing and Customizing. if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { $help_customize = '

' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '

' . '

' . __( 'The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Activate & Publish button above the menu.' ) . '

' . '

' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '

'; get_current_screen()->add_help_tab( array( 'id' => 'customize-preview-themes', 'title' => __( 'Previewing and Customizing' ), 'content' => $help_customize, ) ); } // End if 'edit_theme_options' && 'customize'. $help_sidebar_autoupdates = ''; // Help tab: Auto-updates. if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) { $help_tab_autoupdates = '

' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '

' . '

' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '

'; get_current_screen()->add_help_tab( array( 'id' => 'plugins-themes-auto-updates', 'title' => __( 'Auto-updates' ), 'content' => $help_tab_autoupdates, ) ); $help_sidebar_autoupdates = '

' . __( 'Documentation on Auto-updates' ) . '

'; } // End if 'update_themes' && 'wp_is_auto_update_enabled_for_type'. get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Using Themes' ) . '

' . '

' . __( 'Documentation on Managing Themes' ) . '

' . $help_sidebar_autoupdates . '

' . __( 'Support forums' ) . '

' ); if ( current_user_can( 'switch_themes' ) ) { $themes = wp_prepare_themes_for_js(); } else { $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) ); } $theme = ! empty( $_REQUEST['theme'] ) ? sanitize_text_field( $_REQUEST['theme'] ) : ''; $search = ! empty( $_REQUEST['search'] ) ? sanitize_text_field( $_REQUEST['search'] ) : ''; wp_localize_script( 'theme', '_wpThemeSettings', array( 'themes' => $themes, 'settings' => array( 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), ), 'l10n' => array( 'addNew' => __( 'Add New Theme' ), 'search' => __( 'Search installed themes' ), /* translators: %d: Number of themes. */ 'themesFound' => __( 'Number of Themes found: %d' ), 'noThemesFound' => __( 'No themes found. Try a different search.' ), ), ) ); add_thickbox(); wp_enqueue_script( 'theme' ); wp_enqueue_script( 'updates' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>


'message1', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['activated'] ) ) { if ( isset( $_GET['previewed'] ) ) { wp_admin_notice( __( 'Settings saved and theme activated.' ) . ' ' . __( 'Visit site' ) . '', array( 'id' => 'message2', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } else { wp_admin_notice( __( 'New theme activated.' ) . ' ' . __( 'Visit site' ) . '', array( 'id' => 'message2', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } } elseif ( isset( $_GET['deleted'] ) ) { wp_admin_notice( __( 'Theme deleted.' ), array( 'id' => 'message3', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['delete-active-child'] ) ) { wp_admin_notice( __( 'You cannot delete a theme while it has an active child theme.' ), array( 'id' => 'message4', 'additional_classes' => array( 'error' ), ) ); } elseif ( isset( $_GET['resumed'] ) ) { wp_admin_notice( __( 'Theme resumed.' ), array( 'id' => 'message5', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) { wp_admin_notice( __( 'Theme could not be resumed because it triggered a fatal error.' ), array( 'id' => 'message6', 'additional_classes' => array( 'error' ), ) ); } elseif ( isset( $_GET['enabled-auto-update'] ) ) { wp_admin_notice( __( 'Theme will be auto-updated.' ), array( 'id' => 'message7', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['disabled-auto-update'] ) ) { wp_admin_notice( __( 'Theme will no longer be auto-updated.' ), array( 'id' => 'message8', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } $current_theme = wp_get_theme(); if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { wp_admin_notice( __( 'Error:' ) . ' ' . $current_theme->errors()->get_error_message(), array( 'additional_classes' => array( 'error' ), ) ); } $current_theme_actions = array(); if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { $forbidden_paths = array( 'themes.php', 'theme-editor.php', 'site-editor.php', 'edit.php?post_type=wp_navigation', ); foreach ( (array) $submenu['themes.php'] as $item ) { $class = ''; if ( in_array( $item[2], $forbidden_paths, true ) || str_starts_with( $item[2], 'customize.php' ) ) { continue; } // 0 = name, 1 = capability, 2 = file. if ( 0 === strcmp( $self, $item[2] ) && empty( $parent_file ) || $parent_file && $item[2] === $parent_file ) { $class = ' current'; } if ( ! empty( $submenu[ $item[2] ] ) ) { $submenu[ $item[2] ] = array_values( $submenu[ $item[2] ] ); // Re-index. $menu_hook = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] ); if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) { $current_theme_actions[] = "{$item[0]}"; } else { $current_theme_actions[] = "{$item[0]}"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_file = $item[2]; if ( current_user_can( 'customize' ) ) { if ( 'custom-header' === $menu_file ) { $current_theme_actions[] = "{$item[0]}"; } elseif ( 'custom-background' === $menu_file ) { $current_theme_actions[] = "{$item[0]}"; } } $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { $current_theme_actions[] = "{$item[0]}"; } else { $current_theme_actions[] = "{$item[0]}"; } } } } $class_name = 'theme-browser'; if ( ! empty( $_GET['search'] ) ) { $class_name .= ' search-loading'; } ?>
Update now' ); } else { $new_version_available = __( 'New version available.' ); } wp_admin_notice( $new_version_available, array( 'type' => 'warning', 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), ) ); else : $theme_update_error = ''; if ( ! $theme['updateResponse']['compatibleWP'] && ! $theme['updateResponse']['compatiblePHP'] ) { $theme_update_error .= sprintf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), $theme['name'] ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { $theme_update_error .= sprintf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( 'Please update WordPress, and then learn more about updating PHP.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '', false ); } elseif ( current_user_can( 'update_core' ) ) { $theme_update_error .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { $theme_update_error .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '', false ); } } elseif ( ! $theme['updateResponse']['compatibleWP'] ) { $theme_update_error .= sprintf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), $theme['name'] ); if ( current_user_can( 'update_core' ) ) { $theme_update_error .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $theme['updateResponse']['compatiblePHP'] ) { $theme_update_error .= sprintf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of PHP.' ), $theme['name'] ); if ( current_user_can( 'update_php' ) ) { $theme_update_error .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '', false ); } } wp_admin_notice( $theme_update_error, array( 'type' => 'error', 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), ) ); endif; endif; if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) { $message = ''; if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) { $message = __( 'This theme does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { $message .= sprintf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( 'Please update WordPress, and then learn more about updating PHP.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); $message .= wp_update_php_annotation( '

', '', false ); } elseif ( current_user_can( 'update_core' ) ) { $message .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { $message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); $message .= wp_update_php_annotation( '

', '', false ); } } elseif ( ! $theme['compatibleWP'] ) { $message .= __( 'This theme does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { $message .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $theme['compatiblePHP'] ) { $message .= __( 'This theme does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { $message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); $message .= wp_update_php_annotation( '

', '', false ); } } wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'inline', 'notice-alt' ), ) ); } /* translators: %s: Theme name. */ $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] ); ?>

true ) ); if ( ! is_multisite() && $broken_themes ) { ?>

errors()->get_error_code() ) { $stylesheet = $broken_theme->get_stylesheet(); $resume_url = add_query_arg( array( 'action' => 'resume', 'stylesheet' => urlencode( $stylesheet ), ), admin_url( 'themes.php' ) ); $resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet ); ?> get_stylesheet(); $delete_url = add_query_arg( array( 'action' => 'delete', 'stylesheet' => urlencode( $stylesheet ), ), admin_url( 'themes.php' ) ); $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet ); ?> errors()->get_error_code() ) { $parent_theme_name = $broken_theme->get( 'Template' ); $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) ); if ( ! is_wp_error( $parent_theme ) ) { $install_url = add_query_arg( array( 'action' => 'install-theme', 'theme' => urlencode( $parent_theme_name ), ), admin_url( 'update.php' ) ); $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name ); ?>
get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?> errors()->get_error_message(); ?>
'error', 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), ) ); $template = '
<# if ( data.autoupdate.supported ) { #> <# if ( data.autoupdate.forced === false ) { #> ' . __( 'Auto-updates disabled' ) . ' <# } else if ( data.autoupdate.forced ) { #> ' . __( 'Auto-updates enabled' ) . ' <# } else if ( data.autoupdate.enabled ) { #> <# } else { #> <# } #> <# } #> <# if ( data.hasUpdate ) { #> <# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #> <# } else { #> <# } #> ' . $notice . '
'; /** * Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay). * * See {@see wp_prepare_themes_for_js()} for the properties of the `data` object. * * @since 5.5.0 * * @param string $template The template for displaying the auto-update setting link. */ return apply_filters( 'theme_auto_update_setting_template', $template ); } /* * The tmpl-theme template is synchronized with PHP above! */ ?> wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; export.php000064400000026030147177044200006605 0ustar00 add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '

' . __( 'You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.' ) . '

' . '

' . __( 'Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.' ) . '

', ) ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Export' ) . '

' . '

' . __( 'Support forums' ) . '

' ); // If the 'download' URL parameter is set, a WXR export file is baked and returned. if ( isset( $_GET['download'] ) ) { $args = array(); if ( ! isset( $_GET['content'] ) || 'all' === $_GET['content'] ) { $args['content'] = 'all'; } elseif ( 'posts' === $_GET['content'] ) { $args['content'] = 'post'; if ( $_GET['cat'] ) { $args['category'] = (int) $_GET['cat']; } if ( $_GET['post_author'] ) { $args['author'] = (int) $_GET['post_author']; } if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) { $args['start_date'] = $_GET['post_start_date']; $args['end_date'] = $_GET['post_end_date']; } if ( $_GET['post_status'] ) { $args['status'] = $_GET['post_status']; } } elseif ( 'pages' === $_GET['content'] ) { $args['content'] = 'page'; if ( $_GET['page_author'] ) { $args['author'] = (int) $_GET['page_author']; } if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) { $args['start_date'] = $_GET['page_start_date']; $args['end_date'] = $_GET['page_end_date']; } if ( $_GET['page_status'] ) { $args['status'] = $_GET['page_status']; } } elseif ( 'attachment' === $_GET['content'] ) { $args['content'] = 'attachment'; if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) { $args['start_date'] = $_GET['attachment_start_date']; $args['end_date'] = $_GET['attachment_end_date']; } } else { $args['content'] = $_GET['content']; } /** * Filters the export args. * * @since 3.5.0 * * @param array $args The arguments to send to the exporter. */ $args = apply_filters( 'export_args', $args ); export_wp( $args ); die(); } require_once ABSPATH . 'wp-admin/admin-header.php'; /** * Creates the date options fields for exporting a given post type. * * @since 3.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $post_type The post type. Default 'post'. */ function export_date_options( $post_type = 'post' ) { global $wpdb, $wp_locale; $months = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month FROM $wpdb->posts WHERE post_type = %s AND post_status != 'auto-draft' ORDER BY post_date DESC", $post_type ) ); $month_count = count( $months ); if ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) { return; } foreach ( $months as $date ) { if ( 0 === (int) $date->year ) { continue; } $month = zeroise( $date->month, 2 ); printf( '', esc_attr( $date->year . '-' . $month ), $wp_locale->get_month( $month ) . ' ' . $date->year ); } } ?>

false, 'can_export' => true, ), 'objects' ) as $post_type ) : ?>

js/iris.min.js000064400000056133147177044200007264 0ustar00/*! This file is auto-generated */ /*! Iris Color Picker - v1.1.1 - 2021-10-05 * https://github.com/Automattic/Iris * Copyright (c) 2021 Matt Wiebe; Licensed GPLv2 */ !function(a,b){function c(){var b,c,d="backgroundImage";j?k="filter":(b=a('
'),c="linear-gradient(top,#fff,#000)",a.each(l,function(a,e){if(b.css(d,e+c),b.css(d).match("gradient"))return k=a,!1}),!1===k&&(b.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),b.css(d).match("gradient")&&(k="webkit")),b.remove())}function d(a,b){return a="top"===a?"top":"left",b=Array.isArray(b)?b:Array.prototype.slice.call(arguments,1),"webkit"===k?f(a,b):l[k]+"linear-gradient("+a+", "+b.join(", ")+")"}function e(b,c){var d,e,f,h,i,j,k,l,m;b="top"===b?"top":"left",c=Array.isArray(c)?c:Array.prototype.slice.call(arguments,1),d="top"===b?0:1,e=a(this),f=c.length-1,h="filter",i=1===d?"left":"top",j=1===d?"right":"bottom",k=1===d?"height":"width",l='
',m="","static"===e.css("position")&&e.css({position:"relative"}),c=g(c),a.each(c,function(a,b){var e,g,h;if(a===f)return!1;e=c[a+1],b.stop!==e.stop&&(g=100-parseFloat(e.stop)+"%",b.octoHex=new Color(b.color).toIEOctoHex(),e.octoHex=new Color(e.color).toIEOctoHex(),h="progid:DXImageTransform.Microsoft.Gradient(GradientType="+d+", StartColorStr='"+b.octoHex+"', EndColorStr='"+e.octoHex+"')",m+=l.replace("%start%",b.stop).replace("%end%",g).replace("%filter%",h))}),e.find(".iris-ie-gradient-shim").remove(),a(m).prependTo(e)}function f(b,c){var d=[];return b="top"===b?"0% 0%,0% 100%,":"0% 100%,100% 100%,",c=g(c),a.each(c,function(a,b){d.push("color-stop("+parseFloat(b.stop)/100+", "+b.color+")")}),"-webkit-gradient(linear,"+b+d.join(",")+")"}function g(b){var c=[],d=[],e=[],f=b.length-1;return a.each(b,function(a,b){var e=b,f=!1,g=b.match(/1?[0-9]{1,2}%$/);g&&(e=b.replace(/\s?1?[0-9]{1,2}%$/,""),f=g.shift()),c.push(e),d.push(f)}),!1===d[0]&&(d[0]="0%"),!1===d[f]&&(d[f]="100%"),d=h(d),a.each(d,function(a){e[a]={color:c[a],stop:d[a]}}),e}function h(b){var c,d,e,f,g=0,i=b.length-1,j=0,k=!1;if(b.length<=2||a.inArray(!1,b)<0)return b;for(;j'),c=a(''),d=Array.isArray(this.options.palettes)?this.options.palettes:this._palettes;this.picker.find(".iris-palette-container").length&&(b=this.picker.find(".iris-palette-container").detach().html("")),a.each(d,function(a,d){c.clone().data("color",d).css("backgroundColor",d).appendTo(b).height(10).width(10)}),this.picker.append(b)},_paint:function(){var a=this;a.horizontalSlider?a._paintDimension("left","strip"):a._paintDimension("top","strip"),a._paintDimension("top","vert"),a._paintDimension("left","horiz")},_paintDimension:function(a,b){var c,d=this,e=d._color,f=d.options.mode,g=d._getHSpaceColor(),h=d.controls[b],i=d.options.controls;if(b!==d.active&&("square"!==d.active||"strip"===b))switch(i[b]){case"h":if("hsv"===f){switch(g=e.clone(),b){case"horiz":g[i.vert](100);break;case"vert":g[i.horiz](100);break;case"strip":g.setHSpace("hsl")}c=g.toHsl()}else c="strip"===b?{s:g.s,l:g.l}:{s:100,l:g.l};h.rainbowGradient(a,c);break;case"s":"hsv"===f?"vert"===b?c=[e.clone().a(0).s(0).toCSS("rgba"),e.clone().a(1).s(0).toCSS("rgba")]:"strip"===b?c=[e.clone().s(100).toCSS("hsl"),e.clone().s(0).toCSS("hsl")]:"horiz"===b&&(c=["#fff","hsl("+g.h+",100%,50%)"]):c="vert"===b&&"h"===d.options.controls.horiz?["hsla(0, 0%, "+g.l+"%, 0)","hsla(0, 0%, "+g.l+"%, 1)"]:["hsl("+g.h+",0%,50%)","hsl("+g.h+",100%,50%)"],h.gradient(a,c);break;case"l":c="strip"===b?["hsl("+g.h+",100%,100%)","hsl("+g.h+", "+g.s+"%,50%)","hsl("+g.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],h.gradient(a,c);break;case"v":c="strip"===b?[e.clone().v(100).toCSS(),e.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],h.gradient(a,c)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_stripOnlyDimensions:function(){var a=this,b=this.options.width,c=.12*b;a.horizontalSlider?a.picker.css({width:b,height:c}).addClass("iris-only-strip iris-strip-horiz"):a.picker.css({width:c,height:b}).addClass("iris-only-strip iris-strip-vert")},_dimensions:function(b){if("hue"===this.options.type)return this._stripOnlyDimensions();var c,d,e,f,g=this,h=g.options,i=g.controls,j=i.square,k=g.picker.find(".iris-strip"),l="77.5%",m="12%",n=20,o=h.border?h.width-n:h.width,p=Array.isArray(h.palettes)?h.palettes.length:g._palettes.length;if(b&&(j.css("width",""),k.css("width",""),g.picker.css({width:"",height:""})),l=o*(parseFloat(l)/100),m=o*(parseFloat(m)/100),c=h.border?l+n:l,j.width(l).height(l),k.height(l).width(m),g.picker.css({width:h.width,height:c}),!h.palettes)return g.picker.css("paddingBottom","");d=2*l/100,f=l-(p-1)*d,e=f/p,g.picker.find(".iris-palette").each(function(b){var c=0===b?0:d;a(this).css({width:e,height:e,marginLeft:c})}),g.picker.css("paddingBottom",e+d),k.height(e+d+l)},_addInputListeners:function(a){var b=this,c=function(c){var d=new Color(a.val()),e=a.val().replace(/^#/,"");a.removeClass("iris-error"),d.error?""!==e&&a.addClass("iris-error"):d.toString()!==b._color.toString()&&("keyup"===c.type&&e.match(/^[0-9a-fA-F]{3}$/)||b._setOption("color",d.toString()))};a.on("change",c).on("keyup",b._debounce(c,100)),b.options.hide&&a.one("focus",function(){b.show()})},_initControls:function(){var b=this,c=b.controls,d=c.square,e=b.options.controls,f=b._scale[e.strip],g=b.horizontalSlider?"horizontal":"vertical";c.stripSlider.slider({orientation:g,max:f,slide:function(a,c){b.active="strip","h"===e.strip&&"vertical"===g&&(c.value=f-c.value),b._color[e.strip](c.value),b._change.apply(b,arguments)}}),c.squareDrag.draggable({containment:c.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(a,c){b._squareDrag(a,c)},start:function(){d.addClass("iris-dragging"),a(this).addClass("ui-state-focus")},stop:function(){d.removeClass("iris-dragging"),a(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(c){var d="ui-state-focus";c.preventDefault(),"mousedown"===c.type?(b.picker.find("."+d).removeClass(d).trigger("blur"),a(this).addClass(d).trigger("focus")):a(this).removeClass(d)}).on("keydown",function(a){var d=c.square,e=c.squareDrag,f=e.position(),g=b.options.width/100;switch(a.altKey&&(g*=10),a.keyCode){case 37:f.left-=g;break;case 38:f.top-=g;break;case 39:f.left+=g;break;case 40:f.top+=g;break;default:return!0}f.left=Math.max(0,Math.min(f.left,d.width())),f.top=Math.max(0,Math.min(f.top,d.height())),e.css(f),b._squareDrag(a,{position:f}),a.preventDefault()}),d.on("mousedown",function(c){var d,e;1===c.which&&a(c.target).is("div")&&(d=b.controls.square.offset(),e={top:c.pageY-d.top,left:c.pageX-d.left},c.preventDefault(),b._squareDrag(c,{position:e}),c.target=b.controls.squareDrag.get(0),b.controls.squareDrag.css(e).trigger(c))}),b.options.palettes&&b._paletteListeners()},_paletteListeners:function(){var b=this;b.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){b._color.fromCSS(a(this).data("color")),b.active="external",b._change()}).on("keydown.palette",".iris-palette",function(b){if(13!==b.keyCode&&32!==b.keyCode)return!0;b.stopPropagation(),a(this).trigger("click")})},_squareDrag:function(a,b){var c=this,d=c.options.controls,e=c._squareDimensions(),f=Math.round((e.h-b.position.top)/e.h*c._scale[d.vert]),g=c._scale[d.horiz]-Math.round((e.w-b.position.left)/e.w*c._scale[d.horiz]);c._color[d.horiz](g)[d.vert](f),c.active="square",c._change.apply(c,arguments)},_setOption:function(b,c){var d,e,f=this,g=f.options[b],h=!1;switch(f.options[b]=c,b){case"color":f.onlySlider?(c=parseInt(c,10),c=isNaN(c)||c<0||c>359?g:"hsl("+c+",100,50)",f.options.color=f.options[b]=c,f._color=new Color(c).setHSpace(f.options.mode),f.active="external",f._change()):(c=""+c,c.replace(/^#/,""),d=new Color(c).setHSpace(f.options.mode),d.error?f.options[b]=g:(f._color=d,f.options.color=f.options[b]=f._color.toString(),f.active="external",f._change()));break;case"palettes":h=!0,c?f._addPalettes():f.picker.find(".iris-palette-container").remove(),g||f._paletteListeners();break;case"width":h=!0;break;case"border":h=!0,e=c?"addClass":"removeClass",f.picker[e]("iris-border");break;case"mode":case"controls":if(g===c)return;return e=f.element,g=f.options,g.hide=!f.picker.is(":visible"),f.destroy(),f.picker.remove(),a(f.element).iris(g)}h&&f._dimensions(!0)},_squareDimensions:function(a){var c,d=this.controls.square;return a!==b&&d.data("dimensions")?d.data("dimensions"):(this.controls.squareDrag,c={w:d.width(),h:d.height()},d.data("dimensions",c),c)},_isNonHueControl:function(a,b){return"square"===a&&"h"===this.options.controls.strip||"external"!==b&&("h"!==b||"strip"!==a)},_change:function(){var b=this,c=b.controls,d=b._getHSpaceColor(),e=["square","strip"],f=b.options.controls,g=f[b.active]||"external",h=b.hue;"strip"===b.active?e=[]:"external"!==b.active&&e.pop(),a.each(e,function(a,e){var g,h,i;if(e!==b.active)switch(e){case"strip":g="h"!==f.strip||b.horizontalSlider?d[f.strip]:b._scale[f.strip]-d[f.strip],c.stripSlider.slider("value",g);break;case"square":h=b._squareDimensions(),i={left:d[f.horiz]/b._scale[f.horiz]*h.w,top:h.h-d[f.vert]/b._scale[f.vert]*h.h},b.controls.squareDrag.css(i)}}),d.h!==h&&b._isNonHueControl(b.active,g)&&b._color.h(h),b.hue=b._color.h(),b.options.color=b._color.toString(),b._inited&&b._trigger("change",{type:b.active},{color:b._color}),b.element.is(":input")&&!b._color.error&&(b.element.removeClass("iris-error"),b.onlySlider?b.element.val()!==b.hue&&b.element.val(b.hue):b.element.val()!==b._color.toString()&&b.element.val(b._color.toString())),b._paint(),b._inited=!0,b.active=!1},_debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()},color:function(a){return!0===a?this._color.clone():a===b?this._color.toString():void this.option("color",a)}},a.widget("a8c.iris",n),a('").appendTo("head")}(jQuery),function(a,b){var c=function(a,b){return this instanceof c?this._init(a,b):new c(a,b)};c.fn=c.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(a){var c="noop";switch(typeof a){case"object":return a.a!==b&&this.a(a.a),c=a.r!==b?"fromRgb":a.l!==b?"fromHsl":a.v!==b?"fromHsv":c,this[c](a);case"string":return this.fromCSS(a);case"number":return this.fromInt(parseInt(a,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var a=new c(this.toInt()),b=["_alpha","_hSpace","_hsl","_hsv","error"],d=b.length-1;d>=0;d--)a[b[d]]=this[b[d]];return a},setHSpace:function(a){return this._hSpace="hsv"===a?a:"hsl",this},noop:function(){return this},fromCSS:function(a){var b,c=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,a=a.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),a.match(c)&&a.match(/\)$/)){if(b=a.replace(/(\s|%)/g,"").replace(c,"").replace(/,?\);?$/,"").split(","),b.length<3)return this._error();if(4===b.length&&(this.a(parseFloat(b.pop())),this.error))return this;for(var d=b.length-1;d>=0;d--)if(b[d]=parseInt(b[d],10),isNaN(b[d]))return this._error();return a.match(/^rgb/)?this.fromRgb({r:b[0],g:b[1],b:b[2]}):a.match(/^hsv/)?this.fromHsv({h:b[0],s:b[1],v:b[2]}):this.fromHsl({h:b[0],s:b[1],l:b[2]})}return this.fromHex(a)},fromRgb:function(a,c){return"object"!=typeof a||a.r===b||a.g===b||a.b===b?this._error():(this.error=!1,this.fromInt(parseInt((a.r<<16)+(a.g<<8)+a.b,10),c))},fromHex:function(a){return a=a.replace(/^#/,"").replace(/^0x/,""),3===a.length&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),this.error=!/^[0-9A-F]{6}$/i.test(a),this.fromInt(parseInt(a,16))},fromHsl:function(a){var c,d,e,f,g,h,i,j;return"object"!=typeof a||a.h===b||a.s===b||a.l===b?this._error():(this._hsl=a,this._hSpace="hsl",h=a.h/360,i=a.s/100,j=a.l/100,0===i?c=d=e=j:(f=j<.5?j*(1+i):j+i-j*i,g=2*j-f,c=this.hue2rgb(g,f,h+1/3),d=this.hue2rgb(g,f,h),e=this.hue2rgb(g,f,h-1/3)),this.fromRgb({r:255*c,g:255*d,b:255*e},!0))},fromHsv:function(a){var c,d,e,f,g,h,i,j,k,l,m;if("object"!=typeof a||a.h===b||a.s===b||a.v===b)return this._error();switch(this._hsv=a,this._hSpace="hsv",c=a.h/360,d=a.s/100,e=a.v/100,i=Math.floor(6*c),j=6*c-i,k=e*(1-d),l=e*(1-j*d),m=e*(1-(1-j)*d),i%6){case 0:f=e,g=m,h=k;break;case 1:f=l,g=e,h=k;break;case 2:f=k,g=e,h=m;break;case 3:f=k,g=l,h=e;break;case 4:f=m,g=k,h=e;break;case 5:f=e,g=k,h=l}return this.fromRgb({r:255*f,g:255*g,b:255*h},!0)},fromInt:function(a,c){return this._color=parseInt(a,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),c===b&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+6*(b-a)*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},toString:function(){var a=parseInt(this._color,10).toString(16);if(this.error)return"";if(a.length<6)for(var b=6-a.length-1;b>=0;b--)a="0"+a;return"#"+a},toCSS:function(a,b){switch(a=a||"hex",b=parseFloat(b||this._alpha),a){case"rgb":case"rgba":var c=this.toRgb();return b<1?"rgba( "+c.r+", "+c.g+", "+c.b+", "+b+" )":"rgb( "+c.r+", "+c.g+", "+c.b+" )";case"hsl":case"hsla":var d=this.toHsl();return b<1?"hsla( "+d.h+", "+d.s+"%, "+d.l+"%, "+b+" )":"hsl( "+d.h+", "+d.s+"%, "+d.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var a,b,c=this.toRgb(),d=c.r/255,e=c.g/255,f=c.b/255,g=Math.max(d,e,f),h=Math.min(d,e,f),i=(g+h)/2;if(g===h)a=b=0;else{var j=g-h;switch(b=i>.5?j/(2-g-h):j/(g+h),g){case d:a=(e-f)/j+(ed?(b+.05)/(d+.05):(d+.05)/(b+.05)},getMaxContrastColor:function(){var a=this.getDistanceLuminosityFrom(new c("#000")),b=this.getDistanceLuminosityFrom(new c("#fff"));return new c(a>=b?"#000":"#fff")},getReadableContrastingColor:function(a,d){if(!(a instanceof c))return this;var e,f,g=d===b?5:d,h=a.getDistanceLuminosityFrom(this);if(h>=g)return this;if(e=a.getMaxContrastColor(),e.getDistanceLuminosityFrom(a)<=g)return e;for(f=0===e.toInt()?-1:1;hc.range[1]?c.range[1]:d),f[a]=d,this._spaceFunc("from",c.space,f))}},_spaceFunc:function(a,b,c){var d=b||this._hSpace;return this[a+d.charAt(0).toUpperCase()+d.substr(1)](c)}};var d={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var e in d)d.hasOwnProperty(e)&&(c.fn[e]=c.fn._partial(e));"object"==typeof exports?module.exports=c:a.Color=c}(this);js/xfn.js000064400000001344147177044200006321 0ustar00/** * Generates the XHTML Friends Network 'rel' string from the inputs. * * @deprecated 3.5.0 * @output wp-admin/js/xfn.js */ jQuery( function( $ ) { $( '#link_rel' ).prop( 'readonly', true ); $( '#linkxfndiv input' ).on( 'click keyup', function() { var isMe = $( '#me' ).is( ':checked' ), inputs = ''; $( 'input.valinp' ).each( function() { if ( isMe ) { $( this ).prop( 'disabled', true ).parent().addClass( 'disabled' ); } else { $( this ).removeAttr( 'disabled' ).parent().removeClass( 'disabled' ); if ( $( this ).is( ':checked' ) && $( this ).val() !== '') { inputs += $( this ).val() + ' '; } } }); $( '#link_rel' ).val( ( isMe ) ? 'me' : inputs.substr( 0,inputs.length - 1 ) ); }); }); js/image-edit.min.js000064400000036233147177044200010322 0ustar00/*! This file is auto-generated */ !function(c){var s=wp.i18n.__,d=window.imageEdit={iasapi:{},hold:{},postid:"",_view:!1,toggleCropTool:function(t,i,e){var a,o,r,n=c("#image-preview-"+t),s=this.iasapi.getSelection();d.toggleControls(e),"false"==("true"===c(e).attr("aria-expanded")?"true":"false")?(this.iasapi.cancelSelection(),d.setDisabled(c(".imgedit-crop-clear"),0)):(d.setDisabled(c(".imgedit-crop-clear"),1),e=c("#imgedit-start-x-"+t).val()?c("#imgedit-start-x-"+t).val():0,a=c("#imgedit-start-y-"+t).val()?c("#imgedit-start-y-"+t).val():0,o=c("#imgedit-sel-width-"+t).val()?c("#imgedit-sel-width-"+t).val():n.innerWidth(),r=c("#imgedit-sel-height-"+t).val()?c("#imgedit-sel-height-"+t).val():n.innerHeight(),isNaN(s.x1)&&(this.setCropSelection(t,{x1:e,y1:a,x2:o,y2:r,width:o,height:r}),s=this.iasapi.getSelection()),0===s.x1&&0===s.y1&&0===s.x2&&0===s.y2?this.iasapi.setSelection(0,0,n.innerWidth(),n.innerHeight(),!0):this.iasapi.setSelection(e,a,o,r,!0),this.iasapi.setOptions({show:!0}),this.iasapi.update())},handleCropToolClick:function(t,i,e){e.classList.contains("imgedit-crop-clear")?(this.iasapi.cancelSelection(),d.setDisabled(c(".imgedit-crop-apply"),0),c("#imgedit-sel-width-"+t).val(""),c("#imgedit-sel-height-"+t).val(""),c("#imgedit-start-x-"+t).val("0"),c("#imgedit-start-y-"+t).val("0"),c("#imgedit-selection-"+t).val("")):d.crop(t,i,e)},intval:function(t){return 0|t},setDisabled:function(t,i){i?t.removeClass("disabled").prop("disabled",!1):t.addClass("disabled").prop("disabled",!0)},init:function(e){var t=this,i=c("#image-editor-"+t.postid);t.postid!==e&&i.length&&t.close(t.postid),t.hold.sizer=parseFloat(c("#imgedit-sizer-"+e).val()),t.postid=e,c("#imgedit-response-"+e).empty(),c("#imgedit-panel-"+e).on("keypress",function(t){var i=c("#imgedit-nonce-"+e).val();26===t.which&&t.ctrlKey&&d.undo(e,i),25===t.which&&t.ctrlKey&&d.redo(e,i)}),c("#imgedit-panel-"+e).on("keypress",'input[type="text"]',function(t){var i=t.keyCode;if(36this.hold.oh||r&&r>this.hold.ow?(t.css("visibility","visible"),s.prop("disabled",!0)):(t.css("visibility","hidden"),s.prop("disabled",!1)))},getSelRatio:function(t){var i=this.hold.w,e=this.hold.h,a=this.intval(c("#imgedit-crop-width-"+t).val()),t=this.intval(c("#imgedit-crop-height-"+t).val());return a&&t?a+":"+t:i&&e?i+":"+e:"1:1"},filterHistory:function(t,i){var e,a,o,r=c("#imgedit-history-"+t).val(),n=[];if(""===r)return"";if(r=JSON.parse(r),0<(e=this.intval(c("#imgedit-undone-"+t).val())))for(;0').on("load",{history:t.history},function(t){var i=c("#imgedit-crop-"+o),e=d,a=(""!==t.data.history&&(t=JSON.parse(t.data.history))[t.length-1].hasOwnProperty("c")&&(e.setDisabled(c("#image-undo-"+o),!0),c("#image-undo-"+o).trigger("focus")),i.empty().append(n),t=Math.max(e.hold.w,e.hold.h),a=Math.max(c(n).width(),c(n).height()),e.hold.sizer=a

'+t+"

"),i.toggleEditor(o,0,!0),wp.a11y.speak(t,"assertive")}).attr("src",ajaxurl+"?"+c.param(t))},action:function(i,t,e){var a,o,r,n,s=this;if(s.notsaved(i))return!1;if(t={action:"image-editor",_ajax_nonce:t,postid:i},"scale"===e){if(a=c("#imgedit-scale-width-"+i),o=c("#imgedit-scale-height-"+i),r=s.intval(a.val()),n=s.intval(o.val()),r<1)return a.trigger("focus"),!1;if(n<1)return o.trigger("focus"),!1;if(r===s.hold.ow||n===s.hold.oh)return!1;t.do="scale",t.fwidth=r,t.fheight=n}else{if("restore"!==e)return!1;t.do="restore"}s.toggleEditor(i,1),c.post(ajaxurl,t,function(t){c("#image-editor-"+i).empty().append(t.data.html),s.toggleEditor(i,0,!0),s._view&&s._view.refresh()}).done(function(t){t&&t.data.message.msg?wp.a11y.speak(t.data.message.msg):t&&t.data.message.error&&wp.a11y.speak(t.data.message.error)})},save:function(i,t){var e=this.getTarget(i),a=this.filterHistory(i,0),o=this;if(""===a)return!1;this.toggleEditor(i,1),t={action:"image-editor",_ajax_nonce:t,postid:i,history:a,target:e,context:c("#image-edit-context").length?c("#image-edit-context").val():null,do:"save"},c.post(ajaxurl,t,function(t){t.data.error?(c("#imgedit-response-"+i).html('"),d.close(i),wp.a11y.speak(t.data.error)):(t.data.fw&&t.data.fh&&c("#media-dims-"+i).html(t.data.fw+" × "+t.data.fh),t.data.thumbnail&&c(".thumbnail","#thumbnail-head-"+i).attr("src",""+t.data.thumbnail),t.data.msg&&(c("#imgedit-response-"+i).html('"),wp.a11y.speak(t.data.msg)),o._view?o._view.save():d.close(i))})},open:function(e,t,i){this._view=i;var a=c("#image-editor-"+e),o=c("#media-head-"+e),r=c("#imgedit-open-btn-"+e),n=r.siblings(".spinner");if(!r.hasClass("button-activated"))return n.addClass("is-active"),c.ajax({url:ajaxurl,type:"post",data:{action:"image-editor",_ajax_nonce:t,postid:e,do:"open"},beforeSend:function(){r.addClass("button-activated")}}).done(function(t){var i;"-1"===t&&(i=s("Could not load the preview image."),a.html('")),t.data&&t.data.html&&a.html(t.data.html),o.fadeOut("fast",function(){a.fadeIn("fast",function(){i&&c(document).trigger("image-editor-ui-ready")}),r.removeClass("button-activated"),n.removeClass("is-active")}),d.init(e)})},imgLoaded:function(t){var i=c("#image-preview-"+t),e=c("#imgedit-crop-"+t);void 0===this.hold.sizer&&this.init(t),this.calculateImgSize(t),this.initCrop(t,i,e),this.setCropSelection(t,{x1:0,y1:0,x2:0,y2:0,width:i.innerWidth(),height:i.innerHeight()}),this.toggleEditor(t,0,!0)},focusManager:function(){setTimeout(function(){var t=c('.notice[role="alert"]');(t=t.length?t:c(".imgedit-wrap").find(":tabbable:first")).attr("tabindex","-1").trigger("focus")},100)},initCrop:function(r,t,i){var n=this,o=c("#imgedit-sel-width-"+r),s=c("#imgedit-sel-height-"+r),t=c(t);t.data("imgAreaSelect")||(n.iasapi=t.imgAreaSelect({parent:i,instance:!0,handles:!0,keys:!0,minWidth:3,minHeight:3,onInit:function(t){c(t).next().css("position","absolute").nextAll(".imgareaselect-outer").css("position","absolute"),i.children().on("mousedown touchstart",function(t){var i=!1,e=n.iasapi.getSelection(),a=n.intval(c("#imgedit-crop-width-"+r).val()),o=n.intval(c("#imgedit-crop-height-"+r).val());a&&o?i=n.getSelRatio(r):t.shiftKey&&e&&e.width&&e.height&&(i=e.width+":"+e.height),n.iasapi.setOptions({aspectRatio:i})})},onSelectStart:function(){d.setDisabled(c("#imgedit-crop-sel-"+r),1),d.setDisabled(c(".imgedit-crop-clear"),1),d.setDisabled(c(".imgedit-crop-apply"),1)},onSelectEnd:function(t,i){d.setCropSelection(r,i),c("#imgedit-crop > *").is(":visible")||d.toggleControls(c(".imgedit-crop.button"))},onSelectChange:function(t,i){var e=d.hold.sizer,a=d.currentCropSelection;null!=a&&a.width==i.width&&a.height==i.height||(o.val(Math.min(d.hold.w,d.round(i.width/e))),s.val(Math.min(d.hold.h,d.round(i.height/e))),n.currentCropSelection=i)}}))},setCropSelection:function(t,i){var e=c("#imgedit-sel-width-"+t),a=c("#imgedit-sel-height-"+t),o=this.hold.sizer,r=this.hold;if(!(i=i||0)||i.width<3&&i.height<3)return this.setDisabled(c(".imgedit-crop","#imgedit-panel-"+t),1),this.setDisabled(c("#imgedit-crop-sel-"+t),1),c("#imgedit-sel-width-"+t).val(""),c("#imgedit-sel-height-"+t).val(""),c("#imgedit-start-x-"+t).val("0"),c("#imgedit-start-y-"+t).val("0"),c("#imgedit-selection-"+t).val(""),!1;var n=r.w-(Math.round(i.x1/o)+parseInt(e.val())),r=r.h-(Math.round(i.y1/o)+parseInt(a.val())),n={r:1,x:Math.round(i.x1/o)+Math.min(0,n),y:Math.round(i.y1/o)+Math.min(0,r),w:e.val(),h:a.val()};this.setDisabled(c(".imgedit-crop","#imgedit-panel-"+t),1),c("#imgedit-selection-"+t).val(JSON.stringify(n))},close:function(t,i){if((i=i||!1)&&this.notsaved(t))return!1;this.iasapi={},this.hold={},this._view?this._view.back():c("#image-editor-"+t).fadeOut("fast",function(){c("#media-head-"+t).fadeIn("fast",function(){c("#imgedit-open-btn-"+t).trigger("focus")}),c(this).empty()})},notsaved:function(t){var i=c("#imgedit-history-"+t).val(),i=""!==i?JSON.parse(i):[];return this.intval(c("#imgedit-undone-"+t).val())

'+o+"

"),wp.a11y.speak(o,"assertive"),c(i?"#imgedit-crop-height-"+t:"#imgedit-crop-width-"+t).val("")):void 0!==(r=c("#imgedit-crop-"+t).find(".notice-error"))&&r.remove(),this.iasapi.setSelection(e.x1,e.y1,e.x2,a),this.iasapi.update())},validateNumeric:function(t){if(!1===this.intval(c(t).val()))return c(t).val(""),!1}}}(jQuery);js/postbox.min.js000064400000015061147177044200010007 0ustar00/*! This file is auto-generated */ !function(l){var a=l(document),r=wp.i18n.__;window.postboxes={handle_click:function(){var e,o=l(this),s=o.closest(".postbox"),t=s.attr("id");"dashboard_browser_nag"!==t&&(s.toggleClass("closed"),e=!s.hasClass("closed"),(o.hasClass("handlediv")?o:o.closest(".postbox").find("button.handlediv")).attr("aria-expanded",e),"press-this"!==postboxes.page&&postboxes.save_state(postboxes.page),t&&(s.hasClass("closed")||"function"!=typeof postboxes.pbshow?s.hasClass("closed")&&"function"==typeof postboxes.pbhide&&postboxes.pbhide(t):postboxes.pbshow(t)),a.trigger("postbox-toggled",s))},handleOrder:function(){var e=l(this),o=e.closest(".postbox"),s=o.attr("id"),t=o.closest(".meta-box-sortables").find(".postbox:visible"),a=t.length,t=t.index(o);if("dashboard_browser_nag"!==s)if("true"===e.attr("aria-disabled"))s=e.hasClass("handle-order-higher")?r("The box is on the first position"):r("The box is on the last position"),wp.a11y.speak(s);else{if(e.hasClass("handle-order-higher")){if(0===t)return void postboxes.handleOrderBetweenSortables("previous",e,o);o.prevAll(".postbox:visible").eq(0).before(o),e.trigger("focus"),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page)}e.hasClass("handle-order-lower")&&(t+1===a?postboxes.handleOrderBetweenSortables("next",e,o):(o.nextAll(".postbox:visible").eq(0).after(o),e.trigger("focus"),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page)))}},handleOrderBetweenSortables:function(e,o,s){var t=o.closest(".meta-box-sortables").attr("id"),a=[];l(".meta-box-sortables:visible").each(function(){a.push(l(this).attr("id"))}),1!==a.length&&(t=l.inArray(t,a),s=s.detach(),"previous"===e&&l(s).appendTo("#"+a[t-1]),"next"===e&&l(s).prependTo("#"+a[t+1]),postboxes._mark_area(),o.focus(),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page))},updateOrderButtonsProperties:function(){var e=l(".meta-box-sortables:visible:first").attr("id"),o=l(".meta-box-sortables:visible:last").attr("id"),s=l(".postbox:visible:first"),t=l(".postbox:visible:last"),a=s.attr("id"),r=t.attr("id"),i=s.closest(".meta-box-sortables").attr("id"),t=t.closest(".meta-box-sortables").attr("id"),n=l(".handle-order-higher"),d=l(".handle-order-lower");n.attr("aria-disabled","false").removeClass("hidden"),d.attr("aria-disabled","false").removeClass("hidden"),e===o&&a===r&&(n.addClass("hidden"),d.addClass("hidden")),e===i&&l(s).find(".handle-order-higher").attr("aria-disabled","true"),o===t&&l(".postbox:visible .handle-order-lower").last().attr("aria-disabled","true")},add_postbox_toggles:function(t,e){var o=l(".postbox .hndle, .postbox .handlediv"),s=l(".postbox .handle-order-higher, .postbox .handle-order-lower");this.page=t,this.init(t,e),o.on("click.postboxes",this.handle_click),s.on("click.postboxes",this.handleOrder),l(".postbox .hndle a").on("click",function(e){e.stopPropagation()}),l(".postbox a.dismiss").on("click.postboxes",function(e){var o=l(this).parents(".postbox").attr("id")+"-hide";e.preventDefault(),l("#"+o).prop("checked",!1).triggerHandler("click")}),l(".hide-postbox-tog").on("click.postboxes",function(){var e=l(this),o=e.val(),s=l("#"+o);e.prop("checked")?(s.show(),"function"==typeof postboxes.pbshow&&postboxes.pbshow(o)):(s.hide(),"function"==typeof postboxes.pbhide&&postboxes.pbhide(o)),postboxes.save_state(t),postboxes._mark_area(),a.trigger("postbox-toggled",s)}),l('.columns-prefs input[type="radio"]').on("click.postboxes",function(){var e=parseInt(l(this).val(),10);e&&(postboxes._pb_edit(e),postboxes.save_order(t))})},init:function(o,e){var s=l(document.body).hasClass("mobile"),t=l(".postbox .handlediv");l.extend(this,e||{}),l(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",delay:s?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,helper:function(e,o){return o.clone().find(":input").attr("name",function(e,o){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+o}).end()},opacity:.65,start:function(){l("body").addClass("is-dragging-metaboxes"),l(".meta-box-sortables").sortable("refreshPositions")},stop:function(){var e=l(this);l("body").removeClass("is-dragging-metaboxes"),e.find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id?e.sortable("cancel"):(postboxes.updateOrderButtonsProperties(),postboxes.save_order(o))},receive:function(e,o){"dashboard_browser_nag"==o.item[0].id&&l(o.sender).sortable("cancel"),postboxes._mark_area(),a.trigger("postbox-moved",o.item)}}),s&&(l(document.body).on("orientationchange.postboxes",function(){postboxes._pb_change()}),this._pb_change()),this._mark_area(),this.updateOrderButtonsProperties(),a.on("postbox-toggled",this.updateOrderButtonsProperties),t.each(function(){var e=l(this);e.attr("aria-expanded",!e.closest(".postbox").hasClass("closed"))})},save_state:function(e){var o,s;"nav-menus"!==e&&(o=l(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),s=l(".postbox").filter(":hidden").map(function(){return this.id}).get().join(","),l.post(ajaxurl,{action:"closed-postboxes",closed:o,hidden:s,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:e}))},save_order:function(e){var o=l(".columns-prefs input:checked").val()||0,s={action:"meta-box-order",_ajax_nonce:l("#meta-box-order-nonce").val(),page_columns:o,page:e};l(".meta-box-sortables").each(function(){s["order["+this.id.split("-")[0]+"]"]=l(this).sortable("toArray").join(",")}),l.post(ajaxurl,s,function(e){e.success&&wp.a11y.speak(r("The boxes order has been saved."))})},_mark_area:function(){var o=l("div.postbox:visible").length,e=l("#dashboard-widgets .meta-box-sortables:visible, #post-body .meta-box-sortables:visible"),s=!0;e.each(function(){var e=l(this);1==o||e.children(".postbox:visible").length?(e.removeClass("empty-container"),s=!1):e.addClass("empty-container")}),postboxes.updateEmptySortablesText(e,s)},updateEmptySortablesText:function(e,o){var s=l("#dashboard-widgets").length,t=r(o?"Add boxes from the Screen Options menu":"Drag boxes here");s&&e.each(function(){l(this).hasClass("empty-container")&&l(this).attr("data-emptyString",t)})},_pb_edit:function(e){var o=l(".metabox-holder").get(0);o&&(o.className=o.className.replace(/columns-\d+/,"columns-"+e)),l(document).trigger("postboxes-columnchange")},_pb_change:function(){var e=l('label.columns-prefs-1 input[type="radio"]');switch(window.orientation){case 90:case-90:e.length&&e.is(":checked")||this._pb_edit(2);break;case 0:case 180:l("#poststuff").length?this._pb_edit(1):e.length&&e.is(":checked")||this._pb_edit(2)}},pbshow:!1,pbhide:!1}}(jQuery);js/customize-widgets.min.js000064400000066645147177044200012015 0ustar00/*! This file is auto-generated */ !function(u,h){var p,f;function c(e){var t={number:null,id_base:null},i=e.match(/^(.+)-(\d+)$/);return i?(t.id_base=i[1],t.number=parseInt(i[2],10)):t.id_base=e,t}u&&u.customize&&((p=u.customize).Widgets=p.Widgets||{},p.Widgets.savedWidgetIds={},p.Widgets.data=_wpCustomizeWidgetsSettings||{},f=p.Widgets.data.l10n,p.Widgets.WidgetModel=Backbone.Model.extend({id:null,temp_id:null,classname:null,control_tpl:null,description:null,is_disabled:null,is_multi:null,multi_number:null,name:null,id_base:null,transport:null,params:[],width:null,height:null,search_matched:!0}),p.Widgets.WidgetCollection=Backbone.Collection.extend({model:p.Widgets.WidgetModel,doSearch:function(e){this.terms!==e&&(this.terms=e,0 .widget-tpl:visible:first")).length&&this.select(t),""!==e.target.value?this.$clearResults.addClass("is-visible"):""===e.target.value&&this.$clearResults.removeClass("is-visible"),this.searchMatchesCount?this.$el.removeClass("no-widgets-found"):this.$el.addClass("no-widgets-found")},500),updateSearchMatchesCount:function(){this.searchMatchesCount=this.collection.where({search_matched:!0}).length},announceSearchMatches:function(){var e=f.widgetsFound.replace("%d",this.searchMatchesCount);this.searchMatchesCount||(e=f.noWidgetsFound),u.a11y.speak(e)},updateList:function(){this.collection.each(function(e){var t=h("#widget-tpl-"+e.id);t.toggle(e.get("search_matched")&&!e.get("is_disabled")),e.get("is_disabled")&&t.is(this.selected)&&(this.selected=null)})},select:function(e){this.selected=h(e),this.selected.siblings(".widget-tpl").removeClass("selected"),this.selected.addClass("selected")},focus:function(e){this.select(h(e.currentTarget))},_submit:function(e){"keypress"===e.type&&13!==e.which&&32!==e.which||this.submit(h(e.currentTarget))},submit:function(e){(e=e||this.selected)&&this.currentSidebarControl&&(this.select(e),e=h(this.selected).data("widget-id"),e=this.collection.findWhere({id:e}))&&((e=this.currentSidebarControl.addWidget(e.get("id_base")))&&e.focus(),this.close())},open:function(e){this.currentSidebarControl=e,_(this.currentSidebarControl.getWidgetFormControls()).each(function(e){e.params.is_wide&&e.collapseForm()}),p.section.has("publish_settings")&&p.section("publish_settings").collapse(),h("body").addClass("adding-widget"),this.$el.find(".selected").removeClass("selected"),this.collection.doSearch(""),p.settings.browser.mobile||this.$search.trigger("focus")},close:function(e){(e=e||{}).returnFocus&&this.currentSidebarControl&&this.currentSidebarControl.container.find(".add-new-widget").focus(),this.currentSidebarControl=null,this.selected=null,h("body").removeClass("adding-widget"),this.$search.val("").trigger("input")},keyboardAccessible:function(e){var t=13===e.which,i=27===e.which,n=40===e.which,s=38===e.which,d=9===e.which,a=e.shiftKey,o=null,r=this.$el.find("> .widget-tpl:visible:first"),l=this.$el.find("> .widget-tpl:visible:last"),c=h(e.target).is(this.$search),g=h(e.target).is(".widget-tpl:visible:last");n||s?(n?c?o=r:this.selected&&0!==this.selected.nextAll(".widget-tpl:visible").length&&(o=this.selected.nextAll(".widget-tpl:visible:first")):s&&(c?o=l:this.selected&&0!==this.selected.prevAll(".widget-tpl:visible").length&&(o=this.selected.prevAll(".widget-tpl:visible:first"))),this.select(o),(o||this.$search).trigger("focus")):t&&!this.$search.val()||(t?this.submit():i&&this.close({returnFocus:!0}),this.currentSidebarControl&&d&&(a&&c||!a&&g)&&(this.currentSidebarControl.container.find(".add-new-widget").focus(),e.preventDefault()))}}),p.Widgets.formSyncHandlers={rss:function(e,t,i){var n=t.find(".widget-error:first"),i=h("
"+i+"
").find(".widget-error:first");n.length&&i.length?n.replaceWith(i):n.length?n.remove():i.length&&t.find(".widget-content:first").prepend(i)}},p.Widgets.WidgetControl=p.Control.extend({defaultExpandedArguments:{duration:"fast",completeCallback:h.noop},initialize:function(e,t){var i=this;i.widgetControlEmbedded=!1,i.widgetContentEmbedded=!1,i.expanded=new p.Value(!1),i.expandedArgumentsQueue=[],i.expanded.bind(function(e){var t=i.expandedArgumentsQueue.shift(),t=h.extend({},i.defaultExpandedArguments,t);i.onChangeExpanded(e,t)}),i.altNotice=!0,p.Control.prototype.initialize.call(i,e,t)},ready:function(){var n=this;n.section()?p.section(n.section(),function(t){function i(e){e&&(n.embedWidgetControl(),t.expanded.unbind(i))}t.expanded()?i(!0):t.expanded.bind(i)}):n.embedWidgetControl()},embedWidgetControl:function(){var e,t=this;t.widgetControlEmbedded||(t.widgetControlEmbedded=!0,e=h(t.params.widget_control),t.container.append(e),t._setupModel(),t._setupWideWidget(),t._setupControlToggle(),t._setupWidgetTitle(),t._setupReorderUI(),t._setupHighlightEffects(),t._setupUpdateUI(),t._setupRemoveUI())},embedWidgetContent:function(){var e,t=this;t.embedWidgetControl(),t.widgetContentEmbedded||(t.widgetContentEmbedded=!0,t.notifications.container=t.getNotificationsContainerElement(),t.notifications.render(),e=h(t.params.widget_content),t.container.find(".widget-content:first").append(e),h(document).trigger("widget-added",[t.container.find(".widget:first")]))},_setupModel:function(){var i=this,e=function(){p.Widgets.savedWidgetIds[i.params.widget_id]=!0};p.bind("ready",e),p.bind("saved",e),this._updateCount=0,this.isWidgetUpdating=!1,this.liveUpdateMode=!0,this.setting.bind(function(e,t){_(t).isEqual(e)||i.isWidgetUpdating||i.updateWidget({instance:e})})},_setupWideWidget:function(){var n,s,e,t,i,d=this;!this.params.is_wide||h(window).width()<=640||(n=this.container.find(".widget-inside"),s=n.find("> .form"),e=h(".wp-full-overlay-sidebar-content:first"),this.container.addClass("wide-widget-control"),this.container.find(".form:first").css({"max-width":this.params.width,"min-height":this.params.height}),i=function(){var e=d.container.offset().top,t=h(window).height(),i=s.outerHeight();n.css("max-height",t),e=Math.max(0,Math.min(Math.max(e,0),t-i)),n.css("top",e)},t=h("#customize-theme-controls"),this.container.on("expand",function(){i(),e.on("scroll",i),h(window).on("resize",i),t.on("expanded collapsed",i)}),this.container.on("collapsed",function(){e.off("scroll",i),h(window).off("resize",i),t.off("expanded collapsed",i)}),p.each(function(e){0===e.id.indexOf("sidebars_widgets[")&&e.bind(function(){d.container.hasClass("expanded")&&i()})}))},_setupControlToggle:function(){var t=this;this.container.find(".widget-top").on("click",function(e){e.preventDefault(),t.getSidebarWidgetsControl().isReordering||t.expanded(!t.expanded())}),this.container.find(".widget-control-close").on("click",function(){t.collapse(),t.container.find(".widget-top .widget-action:first").focus()})},_setupWidgetTitle:function(){var i=this,e=function(){var e=i.setting().title,t=i.container.find(".in-widget-title");e?t.text(": "+e):t.text("")};this.setting.bind(e),e()},_setupReorderUI:function(){var t,e,d=this,s=function(e){e.siblings(".selected").removeClass("selected"),e.addClass("selected");e=e.data("id")===d.params.sidebar_id;d.container.find(".move-widget-btn").prop("disabled",e)};this.container.find(".widget-title-action").after(h(p.Widgets.data.tpl.widgetReorderNav)),e=_.template(p.Widgets.data.tpl.moveWidgetArea),t=h(e({sidebars:_(p.Widgets.registeredSidebars.toArray()).pluck("attributes")})),this.container.find(".widget-top").after(t),(e=function(){var e=t.find("li"),i=0,n=e.filter(function(){return h(this).data("id")===d.params.sidebar_id});e.each(function(){var e=h(this),t=e.data("id"),t=p.Widgets.registeredSidebars.get(t).get("is_rendered");e.toggle(t),t&&(i+=1),e.hasClass("selected")&&!t&&s(n)}),1"+e.data.form+"