- added string localizes;

- added dependencies with rc. versions;
This commit is contained in:
nikitasinelnikov
2019-10-25 01:05:10 +03:00
parent 3ae1fa5303
commit 56af4416bc
4 changed files with 217 additions and 213 deletions
+38 -34
View File
@@ -1,17 +1,21 @@
<?php
namespace um\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Common' ) ) {
/**
* Class Common
*
* @package um\core
*/
class Common {
/**
* Common constructor.
*/
@@ -33,7 +37,7 @@ if ( ! class_exists( 'um\core\Common' ) ) {
if ( is_user_logged_in() ) {
if ( um_user( 'can_not_see_adminbar' ) ) {
$search = array_search( "admin-bar", $classes );
$search = array_search( 'admin-bar', $classes );
if ( ! empty( $search ) ) {
unset( $classes[ $search ] );
}
@@ -50,17 +54,17 @@ if ( ! class_exists( 'um\core\Common' ) ) {
function create_post_types() {
register_post_type( 'um_form', array(
'labels' => array(
'name' => __( 'Forms' ),
'singular_name' => __( 'Form' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __('Add New Form' ),
'edit_item' => __('Edit Form'),
'not_found' => __('You did not create any forms yet'),
'not_found_in_trash' => __('Nothing found in Trash'),
'search_items' => __('Search Forms')
'labels' => array(
'name' => __( 'Forms', 'ultimate-member' ),
'singular_name' => __( 'Form', 'ultimate-member' ),
'add_new' => __( 'Add New', 'ultimate-member' ),
'add_new_item' => __( 'Add New Form', 'ultimate-member' ),
'edit_item' => __( 'Edit Form', 'ultimate-member' ),
'not_found' => __( 'You did not create any forms yet', 'ultimate-member' ),
'not_found_in_trash' => __( 'Nothing found in Trash', 'ultimate-member' ),
'search_items' => __( 'Search Forms', 'ultimate-member' ),
),
'capabilities' => array(
'capabilities' => array(
'edit_post' => 'manage_options',
'read_post' => 'manage_options',
'delete_post' => 'manage_options',
@@ -68,29 +72,29 @@ if ( ! class_exists( 'um\core\Common' ) ) {
'edit_others_posts' => 'manage_options',
'delete_posts' => 'manage_options',
'publish_posts' => 'manage_options',
'read_private_posts' => 'manage_options'
'read_private_posts' => 'manage_options',
),
'show_ui' => true,
'show_in_menu' => false,
'public' => false,
'show_in_rest' => true,
'supports' => array('title')
'show_ui' => true,
'show_in_menu' => false,
'public' => false,
'show_in_rest' => true,
'supports' => array( 'title' ),
) );
if ( UM()->options()->get( 'members_page' ) || ! get_option( 'um_options' ) ) {
register_post_type( 'um_directory', array(
'labels' => array(
'name' => __( 'Member Directories' ),
'singular_name' => __( 'Member Directory' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __('Add New Member Directory' ),
'edit_item' => __('Edit Member Directory'),
'not_found' => __('You did not create any member directories yet'),
'not_found_in_trash' => __('Nothing found in Trash'),
'search_items' => __('Search Member Directories')
'labels' => array(
'name' => __( 'Member Directories', 'ultimate-member' ),
'singular_name' => __( 'Member Directory', 'ultimate-member' ),
'add_new' => __( 'Add New', 'ultimate-member' ),
'add_new_item' => __( 'Add New Member Directory', 'ultimate-member' ),
'edit_item' => __( 'Edit Member Directory', 'ultimate-member' ),
'not_found' => __( 'You did not create any member directories yet', 'ultimate-member' ),
'not_found_in_trash' => __( 'Nothing found in Trash', 'ultimate-member' ),
'search_items' => __( 'Search Member Directories', 'ultimate-member' ),
),
'capabilities' => array(
'capabilities' => array(
'edit_post' => 'manage_options',
'read_post' => 'manage_options',
'delete_post' => 'manage_options',
@@ -98,13 +102,13 @@ if ( ! class_exists( 'um\core\Common' ) ) {
'edit_others_posts' => 'manage_options',
'delete_posts' => 'manage_options',
'publish_posts' => 'manage_options',
'read_private_posts' => 'manage_options'
'read_private_posts' => 'manage_options',
),
'show_ui' => true,
'show_in_menu' => false,
'public' => false,
'show_in_rest' => true,
'supports' => array('title')
'show_ui' => true,
'show_in_menu' => false,
'public' => false,
'show_in_rest' => true,
'supports' => array( 'title' ),
) );
}