Skip to content

Commit

Permalink
Merge pull request #991 from publishpress/release-3.11.5
Browse files Browse the repository at this point in the history
Release 3.11.5
  • Loading branch information
agapetry authored Nov 2, 2023
2 parents 7b5f87d + 12260e4 commit 7a0103b
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 64 deletions.
2 changes: 1 addition & 1 deletion classes/PressShack/LibWP.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public static function getPostID()
}
}

if (!empty($post) && is_object($post)) {
if (!empty($post) && is_object($post) && isset($post->ID)) {
if (!empty($post->post_status) && ('auto-draft' == $post->post_status)) {
return 0;
} else {
Expand Down
25 changes: 25 additions & 0 deletions classes/PublishPress/Permissions/PostFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class PostFilters
private static $instance;

var $skip_teaser; // for use by templates making a direct call to query_posts for non-teased results
var $doing_unfiltered_shortcode = false;
var $anon_results = [];

public static function instance($args = []) {
Expand Down Expand Up @@ -50,6 +51,26 @@ private function init()

add_filter('presspermit_force_post_metacap_check', [$this, 'fltForcePostMetacapCheck'], 10, 2);

add_filter('pre_do_shortcode_tag', function($do_tag, $tag, $attr, $m) {
$this->doing_unfiltered_shortcode = in_array(
$tag,
apply_filters('presspermit_unfiltered_shortcodes', ['fl_builder_insert_layout']),
true
);

if ($this->doing_unfiltered_shortcode) {
$this->doing_unfiltered_shortcode = apply_filters('presspermit_is_unfiltered_shortcode', $this->doing_unfiltered_shortcode, $tag, $attr, $m);
}

return $do_tag;
}, 10, 4);

add_filter('do_shortcode_tag', function($output, $tag, $attr, $m) {
$this->doing_unfiltered_shortcode = false;

return $output;
}, 10, 4);

do_action('presspermit_post_filters');
}

Expand Down Expand Up @@ -140,6 +161,10 @@ public function fltPostsClauses($clauses, $_wp_query = false, $args = [])
{
global $pagenow, $current_user;

if ($this->doing_unfiltered_shortcode) {
return $clauses;
}

// Gallery block in Gutenberg editor: error loading Image Size dropdown options
if (defined('REST_REQUEST') && (0 == strpos($_SERVER['REQUEST_URI'], "/blocks")) && !empty($_REQUEST['context']) && ('edit' == $_REQUEST['context'])) {
return $clauses;
Expand Down
2 changes: 1 addition & 1 deletion classes/PublishPress/Permissions/TermFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function fltTermsClauses($clauses, $taxonomies, $args)
if (!empty($matches[1])) {
$args['object_type'] = get_post_field('post_type', $matches[1]);

} elseif (false !== strpos($referer, $admin_post_new_url)) {
} elseif (false !== strpos($referer, $admin_post_new_rel_url)) {
preg_match("/$admin_post_new_rel_url\?post_type=([a-zA-Z_\-0-9]+)/", $referer, $matches);

if (!empty($matches[1])) {
Expand Down
2 changes: 1 addition & 1 deletion classes/PublishPress/Permissions/TermFiltersCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function fltGetTerms($terms, $taxonomies, $args)
}
} else {
foreach ($terms as $key => $term) {
if (!$term->count) {
if (is_object($term) && isset($term->count) && !$term->count) {
unset($terms[$key]);
}
}
Expand Down
25 changes: 16 additions & 9 deletions common/css/edit-permissions.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,32 @@ div.pp-add-exceptions {
#wpbody-content #pp_add_exception #menu-settings-column {
padding-top: 3px;
}
#pp_add_exception th.pp-select-x-operation,
#pp_add_exception th.pp-select-x-mod-type {
#pp_add_exception .pp-select-x-operation,
#pp_add_exception .pp-select-x-mod-type {
text-align: left;
padding-left: 15px;
}
#pp_add_exception td.pp-select-x-operation,
#pp_add_exception td.pp-select-x-mod-type,
#pp_add_exception td.pp-select-x-via-type {
#pp_add_exception .pp-select-x-operation,
#pp_add_exception .pp-select-x-mod-type,
#pp_add_exception .pp-select-x-via-type {
padding-top: 5px;
padding-left: 15px;
padding-right: 15px;
}

#pp_add_exception td.pp-select-x-via-type {
padding-left: 0;
#pp_add_exception .pp-select-x-via-type {
padding-right: 10px;
}
#pp_add_exception td.pp-select-x-operation label,
#pp_add_exception td.pp-select-x-mod-type label {
#pp_add_exception .pp-select-x-operation label,
#pp_add_exception .pp-select-x-mod-type label {
padding-bottom: 20px;
white-space: nowrap;
}

#pp_add_exception div.pp-checkbox {
margin-bottom: 10px;
}

#pp_add_exception #select-role-item {
margin-bottom: 0;
}
Expand All @@ -127,6 +130,10 @@ div.pp-add-exceptions {
display: none;
}

#pp_add_exception .pp-select-items {
padding-left: 15px;
}

span.nav-tab {
display: none;
}
Expand Down
Binary file modified languages/press-permit-core-es_ES.mo
Binary file not shown.
39 changes: 19 additions & 20 deletions languages/press-permit-core-es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Project-Id-Version: Plugins - PublishPress Permissions: Control User Access "
"for Posts, Pages, Categories, Tags - Stable (latest release)\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/project\n"
"POT-Creation-Date: 2023-10-25T14:57:03+00:00\n"
"PO-Revision-Date: 2023-10-26 14:53+0200\n"
"POT-Creation-Date: 2023-10-26T19:16:40+00:00\n"
"PO-Revision-Date: 2023-10-27 18:01+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
Expand Down Expand Up @@ -193,23 +193,22 @@ msgstr "Grupos personalizados"
msgid "Groups"
msgstr "Grupos"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:93
#: classes/PublishPress/Permissions/PermissionsAdmin.php:138
#: classes/PublishPress/Permissions/PermissionsAdmin.php:170
#: classes/PublishPress/Permissions/PermissionsAdmin.php:95
#: classes/PublishPress/Permissions/PermissionsAdmin.php:140
#: classes/PublishPress/Permissions/PermissionsAdmin.php:172
msgid "(using default capabilities due to invalid %s definition)"
msgstr "(usando capacidades por defecto debido a una definición %s inválida)"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:126
#: classes/PublishPress/Permissions/PermissionsAdmin.php:148
#: classes/PublishPress/Permissions/PermissionsAdmin.php:128
#: classes/PublishPress/Permissions/PermissionsAdmin.php:150
msgid "%1$s %2$s %3$s- %4$s%5$s%6$s"
msgstr "%1$s %2$s %3$s- %4$s%5$s%6$s"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:161
#: classes/PublishPress/Permissions/PermissionsAdmin.php:180
#, fuzzy
#: classes/PublishPress/Permissions/PermissionsAdmin.php:163
#: classes/PublishPress/Permissions/PermissionsAdmin.php:182
#| msgid "%1$s %2$s %3$s"
msgid "%1$s %2$s%3$s"
msgstr "%1$s %2$s %3$s"
msgstr "%1$s %2$s%3$s"

#: classes/PublishPress/Permissions/PluginStatus.php:12
msgid ""
Expand Down Expand Up @@ -575,10 +574,8 @@ msgstr "Menú de navegación (bloque)"
#: classes/PublishPress/Permissions/UI/AgentPermissionsUI.php:98
#: classes/PublishPress/Permissions/UI/AgentPermissionsUI.php:851
#: classes/PublishPress/Permissions/UI/SettingsTabCore.php:214
#, fuzzy
#| msgid "Block:"
msgid "Block"
msgstr "Bloquear:"
msgstr "Bloque"

#: classes/PublishPress/Permissions/UI/AgentPermissionsUI.php:111
msgid "n/a"
Expand Down Expand Up @@ -784,10 +781,8 @@ msgstr "Permisos específicos"

#: classes/PublishPress/Permissions/UI/AgentPermissionsUI.php:855
#: modules/presspermit-collaboration/classes/Permissions/Collab/AdminFilters.php:206
#, fuzzy
#| msgid "Nav Menu Editing"
msgid "Nav Menu (Legacy)"
msgstr "Edición del menú de navegación"
msgstr "Menú de navegación (heredado)"

#: classes/PublishPress/Permissions/UI/AgentPermissionsUI.php:876
msgid "(all post types)"
Expand Down Expand Up @@ -1124,15 +1119,19 @@ msgstr ""
msgid "Permissions Settings"
msgstr "Ajustes de los permisos"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:98
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:99
msgid "Permissions: Select this %s as Parent"
msgstr "Permisos: Selecciona este %s como padre"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:102
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:107
msgid "Permissions: Assign Terms to this %s"
msgstr "Permisos: Asignar términos a esta %s"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:115
msgid "Permissions: %s this %s"
msgstr "Permisos: %s este %s"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:150
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:164
#: classes/PublishPress/Permissions/UI/Dashboard/TermEdit.php:337
msgid "enable custom permissions for %s"
msgstr "activar los permisos personalizados para %s"
Expand Down
Binary file modified languages/press-permit-core-fr_FR.mo
Binary file not shown.
29 changes: 16 additions & 13 deletions languages/press-permit-core-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Project-Id-Version: Plugins - PublishPress Permissions: Control User Access "
"for Posts, Pages, Categories, Tags - Stable (latest release)\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/project\n"
"POT-Creation-Date: 2023-10-25T14:57:03+00:00\n"
"PO-Revision-Date: 2023-10-26 14:57+0200\n"
"POT-Creation-Date: 2023-10-26T19:16:40+00:00\n"
"PO-Revision-Date: 2023-10-27 18:02+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
Expand Down Expand Up @@ -196,22 +196,21 @@ msgstr "Groupes personnalisés"
msgid "Groups"
msgstr "Groupes"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:93
#: classes/PublishPress/Permissions/PermissionsAdmin.php:138
#: classes/PublishPress/Permissions/PermissionsAdmin.php:170
#: classes/PublishPress/Permissions/PermissionsAdmin.php:95
#: classes/PublishPress/Permissions/PermissionsAdmin.php:140
#: classes/PublishPress/Permissions/PermissionsAdmin.php:172
msgid "(using default capabilities due to invalid %s definition)"
msgstr ""
"(utilisation des permissions par défaut en raison d’une définition %s "
"invalide)"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:126
#: classes/PublishPress/Permissions/PermissionsAdmin.php:148
#: classes/PublishPress/Permissions/PermissionsAdmin.php:128
#: classes/PublishPress/Permissions/PermissionsAdmin.php:150
msgid "%1$s %2$s %3$s- %4$s%5$s%6$s"
msgstr "%1$s %2$s %3$s- %4$s%5$s%6$s"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:161
#: classes/PublishPress/Permissions/PermissionsAdmin.php:180
#| msgid "%1$s %2$s %3$s"
#: classes/PublishPress/Permissions/PermissionsAdmin.php:163
#: classes/PublishPress/Permissions/PermissionsAdmin.php:182
msgid "%1$s %2$s%3$s"
msgstr "%1$s %2$s%3$s"

Expand Down Expand Up @@ -1128,15 +1127,19 @@ msgstr ""
msgid "Permissions Settings"
msgstr "Réglages des permissions"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:98
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:99
msgid "Permissions: Select this %s as Parent"
msgstr "Droits : Sélectionnez cette %s comme parent"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:102
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:107
msgid "Permissions: Assign Terms to this %s"
msgstr "Droits : assigner des termes à cette %s"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:115
msgid "Permissions: %s this %s"
msgstr "Droits : %s cette %s"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:150
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:164
#: classes/PublishPress/Permissions/UI/Dashboard/TermEdit.php:337
msgid "enable custom permissions for %s"
msgstr "activer les droits avancés pour %s"
Expand Down
Binary file modified languages/press-permit-core-it_IT.mo
Binary file not shown.
29 changes: 16 additions & 13 deletions languages/press-permit-core-it_IT.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Project-Id-Version: Plugins - PublishPress Permissions: Control User Access "
"for Posts, Pages, Categories, Tags - Stable (latest release)\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/project\n"
"POT-Creation-Date: 2023-10-25T14:57:03+00:00\n"
"PO-Revision-Date: 2023-10-26 14:34+0200\n"
"POT-Creation-Date: 2023-10-26T19:16:40+00:00\n"
"PO-Revision-Date: 2023-10-27 17:52+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: it\n"
Expand Down Expand Up @@ -192,21 +192,20 @@ msgstr "Gruppi personalizzati"
msgid "Groups"
msgstr "Gruppi"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:93
#: classes/PublishPress/Permissions/PermissionsAdmin.php:138
#: classes/PublishPress/Permissions/PermissionsAdmin.php:170
#: classes/PublishPress/Permissions/PermissionsAdmin.php:95
#: classes/PublishPress/Permissions/PermissionsAdmin.php:140
#: classes/PublishPress/Permissions/PermissionsAdmin.php:172
msgid "(using default capabilities due to invalid %s definition)"
msgstr ""
"(usando le capacità predefinite a causa della definizione %s non valida)"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:126
#: classes/PublishPress/Permissions/PermissionsAdmin.php:148
#: classes/PublishPress/Permissions/PermissionsAdmin.php:128
#: classes/PublishPress/Permissions/PermissionsAdmin.php:150
msgid "%1$s %2$s %3$s- %4$s%5$s%6$s"
msgstr "%1$s %2$s %3$s- %4$s%5$s%6$s"

#: classes/PublishPress/Permissions/PermissionsAdmin.php:161
#: classes/PublishPress/Permissions/PermissionsAdmin.php:180
#| msgid "%1$s %2$s %3$s"
#: classes/PublishPress/Permissions/PermissionsAdmin.php:163
#: classes/PublishPress/Permissions/PermissionsAdmin.php:182
msgid "%1$s %2$s%3$s"
msgstr "%1$s %2$s%3$s"

Expand Down Expand Up @@ -1118,15 +1117,19 @@ msgstr ""
msgid "Permissions Settings"
msgstr "Impostazioni delle autorizzazioni"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:98
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:99
msgid "Permissions: Select this %s as Parent"
msgstr "Autorizzazioni: Seleziona questo %s come genitore"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:102
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:107
msgid "Permissions: Assign Terms to this %s"
msgstr "Autorizzazioni: Assegna termini a questo %s"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:115
msgid "Permissions: %s this %s"
msgstr "Autorizzazioni: %s questo %s"

#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:150
#: classes/PublishPress/Permissions/UI/Dashboard/PostEdit.php:164
#: classes/PublishPress/Permissions/UI/Dashboard/TermEdit.php:337
msgid "enable custom permissions for %s"
msgstr "abilita autorizzazioni personalizzate per %s"
Expand Down
4 changes: 2 additions & 2 deletions languages/press-permit-core.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the same license as the PublishPress Permissions plugin.
msgid ""
msgstr ""
"Project-Id-Version: PublishPress Permissions 3.11.4\n"
"Project-Id-Version: PublishPress Permissions 3.11.5\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/project\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-10-26T19:16:40+00:00\n"
"POT-Creation-Date: 2023-11-01T18:39:50+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.8.1\n"
"X-Domain: press-permit-core\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ function __construct() {

require_once(PRESSPERMIT_COLLAB_CLASSPATH . '/Capabilities.php');

add_action('init', [$this, 'init']);

add_action('presspermit_pre_init', [$this, 'actOnInit']);
add_action('presspermit_options', [$this, 'actAdjustOptions']);
add_filter('presspermit_role_caps', [$this, 'fltRoleCaps'], 10, 2);
add_filter('presspermit_pattern_roles', [$this, 'fltPatternRoles']);
add_action('presspermit_roles_defined', [$this, 'actSetRoleUsage']);

add_action('presspermit_maintenance_triggers', [$this, 'actLoadFilters']); // fires early if is_admin() - at bottom of AdminUI constructor
Expand Down Expand Up @@ -150,6 +151,11 @@ function __construct() {
add_filter('presspermit_pre_object_terms', [$this, 'fltPrePostTerms'], 50, 3);
}

function init()
{
add_filter('presspermit_pattern_roles', [$this, 'fltPatternRoles']);
}

function fltDefaultOptions($def)
{
$new = [
Expand Down
Loading

0 comments on commit 7a0103b

Please sign in to comment.