khaihihi
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
$feature_toggles = Yoast_Feature_Toggles::instance()->get_all();
|
||||
|
||||
?>
|
||||
<h2><?php esc_html_e( 'Features', 'wordpress-seo' ); ?></h2>
|
||||
<div class="yoast-measure">
|
||||
<?php
|
||||
echo sprintf(
|
||||
/* translators: %s expands to Yoast SEO */
|
||||
esc_html__( 'This tab allows you to selectively disable %s features for all sites in the network. By default all features are enabled, which allows site admins to choose for themselves if they want to toggle a feature on or off for their site. When you disable a feature here, site admins will not be able to use that feature at all.', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
);
|
||||
|
||||
foreach ( $feature_toggles as $feature ) {
|
||||
$help_text = esc_html( $feature->label );
|
||||
if ( ! empty( $feature->extra ) ) {
|
||||
$help_text .= ' ' . $feature->extra;
|
||||
}
|
||||
if ( ! empty( $feature->read_more_label ) ) {
|
||||
$help_text .= ' ';
|
||||
$help_text .= sprintf(
|
||||
'<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
|
||||
esc_url( WPSEO_Shortlinker::get( $feature->read_more_url ) ),
|
||||
esc_html( $feature->read_more_label )
|
||||
);
|
||||
}
|
||||
|
||||
$feature_help = new WPSEO_Admin_Help_Panel(
|
||||
WPSEO_Option::ALLOW_KEY_PREFIX . $feature->setting,
|
||||
/* translators: %s expands to a feature's name */
|
||||
sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $feature->name ) ),
|
||||
$help_text
|
||||
);
|
||||
|
||||
$yform->toggle_switch(
|
||||
WPSEO_Option::ALLOW_KEY_PREFIX . $feature->setting,
|
||||
[
|
||||
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
||||
'off' => __( 'Disable', 'wordpress-seo' ),
|
||||
],
|
||||
'<strong>' . $feature->name . '</strong>',
|
||||
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
||||
);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Required to prevent our settings framework from saving the default because the field
|
||||
* isn't explicitly set when saving the Dashboard page.
|
||||
*/
|
||||
$yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* {@internal Important: Make sure the options added to the array here are in line with the
|
||||
* options set in the WPSEO_Option_MS::$allowed_access_options property.}}
|
||||
*/
|
||||
$yform->select(
|
||||
'access',
|
||||
/* translators: %1$s expands to Yoast SEO */
|
||||
sprintf( __( 'Who should have access to the %1$s settings', 'wordpress-seo' ), 'Yoast SEO' ),
|
||||
[
|
||||
'admin' => __( 'Site Admins (default)', 'wordpress-seo' ),
|
||||
'superadmin' => __( 'Super Admins only', 'wordpress-seo' ),
|
||||
]
|
||||
);
|
||||
|
||||
if ( get_blog_count() <= 100 ) {
|
||||
$network_admin = new Yoast_Network_Admin();
|
||||
|
||||
$yform->select(
|
||||
'defaultblog',
|
||||
__( 'New sites in the network inherit their SEO settings from this site', 'wordpress-seo' ),
|
||||
$network_admin->get_site_choices( true, true )
|
||||
);
|
||||
echo '<p>' . esc_html__( 'Choose the site whose settings you want to use as default for all sites that are added to your network. If you choose \'None\', the normal plugin defaults will be used.', 'wordpress-seo' ) . '</p>';
|
||||
}
|
||||
else {
|
||||
$yform->textinput( 'defaultblog', __( 'New sites in the network inherit their SEO settings from this site', 'wordpress-seo' ) );
|
||||
echo '<p>';
|
||||
printf(
|
||||
/* translators: 1: link open tag; 2: link close tag. */
|
||||
esc_html__( 'Enter the %1$sSite ID%2$s for the site whose settings you want to use as default for all sites that are added to your network. Leave empty for none (i.e. the normal plugin defaults will be used).', 'wordpress-seo' ),
|
||||
'<a href="' . esc_url( network_admin_url( 'sites.php' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
echo '</p>';
|
||||
}
|
||||
|
||||
echo '<p><strong>' . esc_html__( 'Take note:', 'wordpress-seo' ) . '</strong> ' . esc_html__( 'Privacy sensitive (FB admins and such), theme specific (title rewrite) and a few very site specific settings will not be imported to new sites.', 'wordpress-seo' ) . '</p>';
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
echo '<p>' . esc_html__( 'Using this form you can reset a site to the default SEO settings.', 'wordpress-seo' ) . '</p>';
|
||||
|
||||
if ( get_blog_count() <= 100 ) {
|
||||
$network_admin = new Yoast_Network_Admin();
|
||||
|
||||
$yform->select(
|
||||
'site_id',
|
||||
__( 'Site ID', 'wordpress-seo' ),
|
||||
$network_admin->get_site_choices( false, true )
|
||||
);
|
||||
}
|
||||
else {
|
||||
$yform->textinput( 'site_id', __( 'Site ID', 'wordpress-seo' ) );
|
||||
}
|
||||
|
||||
wp_nonce_field( 'wpseo-network-restore', 'restore_site_nonce', false );
|
||||
echo '<button type="submit" name="action" value="' . esc_attr( Yoast_Network_Admin::RESTORE_SITE_ACTION ) . '" class="button button-primary">' . esc_html__( 'Restore site to defaults', 'wordpress-seo' ) . '</button>';
|
||||
Reference in New Issue
Block a user