Skip to content

Commit

Permalink
Merge pull request #1575 from publishpress/release-v4.1.0
Browse files Browse the repository at this point in the history
Release v4.1.0
  • Loading branch information
olatechpro authored Apr 4, 2024
2 parents 57f0783 + dc16ab2 commit a525d23
Show file tree
Hide file tree
Showing 37 changed files with 17,557 additions and 16,225 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ PublishPress Planner helps you plan and publish content with WordPress. Features

Based on Edit Flow. Edit Flow is produced by Daniel Bachhuber, Mo Jangda, and Scott Bressler, with special help from Andrew Spittle and Andrew Witherspoon.

## Documentation

https://publishpress.com/docs/

## How to report bugs or send suggestions

Feel free to email us via [help@publishpress.com](mailto:help@publishpress.com). We would love to hear you, and will work hard to help you.

### Guidelines

* Write a clear summary
Expand Down
1 change: 1 addition & 0 deletions common/libs/floating-scroll/css/jquery.floatingscroll.css

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

6 changes: 6 additions & 0 deletions common/libs/floating-scroll/js/jquery.floatingscroll.min.js

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

40 changes: 40 additions & 0 deletions common/php/class-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,5 +803,45 @@ public static function isPublishPressModuleEnabled($module_slug)
return isset($publishpress->{$module_slug})
&& $publishpress->{$module_slug}->module->options->enabled === 'on';
}

public function getUserAuthorizedPostStatusOptions($postType)
{
$postStatuses = $this->getPostStatusOptions();

foreach ($postStatuses as $index => $status) {
// Filter publishing posts if the post type is set
if (in_array($status['value'], ['publish', 'future', 'private'])) {
$postTypeObj = get_post_type_object($postType);
if (! current_user_can($postTypeObj->cap->publish_posts)) {
unset($postStatuses[$index]);
}
}
}

return $postStatuses;
}

public function getPostStatusOptions()
{
$postStatuses = [];
$post_statuses_terms = get_terms('post_status', ['hide_empty' => false]);
$post_statuses_terms_slugs = (!is_wp_error($post_statuses_terms)) ? array_column($post_statuses_terms, 'slug') : [];
foreach ($this->get_post_statuses() as $status) {
//add support for capabilities custom statuses
if (defined('PUBLISHPRESS_CAPS_PRO_VERSION')
&& !empty(get_option('cme_custom_status_control'))
&& in_array($status->slug, $post_statuses_terms_slugs)
&& !current_user_can('status_change_' . $status->slug)
) {
continue;
}
$postStatuses[] = [
'value' => esc_attr($status->slug),
'text' => esc_html($status->label),
];
}

return $postStatuses;
}
}
}
38 changes: 38 additions & 0 deletions common/php/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,41 @@ function pp_get_users_with_author_permissions()
return apply_filters('pp_get_users_eligible_to_be_authors', $authors);
}
}

if (!function_exists('pp_planner_admin_notice')) {
/**
* Show admin notices function for use with admin_notices hook.
*
* Constructs admin notice HTML.
*
* @param string $message Message to use in admin notice. Optional. Default empty string.
* @param bool $success Whether or not a success. Optional. Default true.
* @return mixed
*/
function pp_planner_admin_notice($message = '', $success = true)
{

$class = [];
$class[] = $success ? 'updated' : 'error';
$class[] = 'notice is-dismissible';

$messagewrapstart = '<div id="message" class="' . esc_attr(implode(' ', $class)) . '"><p>';

$messagewrapend = '</p></div>';

$action = '';

/**
* Filters the custom admin notice for ppma.
*
*
* @param string $value Complete HTML output for notice.
* @param string $action Action whose message is being generated.
* @param string $message The message to be displayed.
* @param string $messagewrapstart Beginning wrap HTML.
* @param string $messagewrapend Ending wrap HTML.
*/
return apply_filters('ppch_admin_notice', $messagewrapstart . $message . $messagewrapend, $action, $message,
$messagewrapstart, $messagewrapend);
}
}
10 changes: 0 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "git",
"url": "https://github.com/publishpress/wp-browser"
},
{
"type": "vcs",
"url": "https://github.com/publishpress/publishpress-phpcs-standards"
}
],
"require": {
"php": ">=7.2.5"
Expand All @@ -29,7 +21,6 @@
"bartlett/php-compatinfo": "^5.2",
"overtrue/phplint": "^2.1",
"automattic/vipwpcs": "^2.2",
"publishpress/wp-browser": "2.6.5.2",
"codeception/module-phpbrowser": "^1.0.0",
"codeception/module-asserts": "^1.0.0",
"codeception/module-webdriver": "^1.0",
Expand All @@ -40,7 +31,6 @@
"mustache/mustache": "2.14.1",
"squizlabs/php_codesniffer": "3.*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"publishpress/publishpress-phpcs-standards": "dev-main",
"phpcompatibility/php-compatibility": "*"
},
"config": {
Expand Down
Loading

0 comments on commit a525d23

Please sign in to comment.