Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.1.0 #1575

Merged
merged 17 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading