Skip to content

Commit

Permalink
Adapts to WP 5.7 changes about Robots
Browse files Browse the repository at this point in the history
  • Loading branch information
imath committed Mar 29, 2021
1 parent 88ddb5e commit 3e8a6fc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Restricted Site Access companion to control your BuddyPress powered community si
Tested with
-----------

+ WordPress 5.5 (Required)
+ WordPress 5.7 (Required)
+ [BuddyPress](https://wordpress.org/plugins/buddypress/) 6.2 (Required)
+ [Restricted Access Site](https://wordpress.org/plugins/restricted-site-access/) 7.2.0 (Required)
2 changes: 1 addition & 1 deletion class-communaute-protegee.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Communauté Protégée
* Plugin URI: https://github.com/imath/communaute-protegee
* Description: Enrichit l'extension Restricted Site Access pour protéger l'accès aux sites communautaires motorisés par BuddyPress.
* Version: 1.0.0
* Version: 1.0.1
* Author: imath
* Author URI: https://github.com/imath
* Text Domain: communaute-protegee
Expand Down
15 changes: 15 additions & 0 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1051,3 +1051,18 @@ function communaute_protegee_customize_email_control( WP_Customize_Manager $wp_c
)
);
}

/**
* Adapts to WP 5.7 changes about Robots.
*
* @since 1.0.1
*
* @param array $array WP Robots settings.
* @return array Communauté protégée settings.
*/
function communaute_protegee_no_robots( $array ) {
$array = wp_robots_sensitive_page( $array );
$array['nofollow'] = true;

return $array;
}
2 changes: 1 addition & 1 deletion inc/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function communaute_protegee_globals() {
$cp = communaute_protegee();

// Version.
$cp->version = '1.0.0';
$cp->version = '1.0.1';

// Paths.
$cp->dir = plugin_dir_path( dirname( __FILE__ ) );
Expand Down
4 changes: 2 additions & 2 deletions inc/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* @param Communaute_Protegee $cp The main instance of the plugin.
*/
function communaute_protegee_setup_hooks( $cp = null ) {
add_action( 'wp_head', 'wp_no_robots', 1 );
add_action( 'communaute_protegee_head', 'wp_no_robots', 1 );
add_action( 'communaute_protegee_head', 'wp_robots', 1 );
add_filter( 'wp_robots', 'communaute_protegee_no_robots', 1, 1 );

// Icon hooks.
add_filter( 'site_icon_image_sizes', 'communaute_protegee_login_screen_add_icon_size', 10, 1 );
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"type": "git",
"url": "https://github.com/imath/communaute-protegee.git"
},
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"node-forge": ">=0.10.0"
}
Expand Down

0 comments on commit 3e8a6fc

Please sign in to comment.