Домой GOOD WEBMASETER Citadela Citadela и дополнительная вкладка "Предметы" WP-Recall
1ответ(ов) в теме
FSM
не в сети 3 недели
На сайте с 17.08.2022
Администратор
Тем 49
Сообщения 41
1
16:42

remove_action( 'init', 'rcl_init_publics_block', 20 );
add_action( 'init', 'rcl_init_publics_block1', 30 );
function rcl_init_publics_block1() {

  if ( rcl_get_option( 'publics_block_rcl' ) == 1 ) {

    $post_types = get_post_types( array(
      'public'   => true,
      '_builtin' => false
    ), 'objects' );

    $types = array( 'post' => ( 'Records', 'wp-recall' ) );

    foreach ( $post_types as $post_type ) {
      $types[ $post_type->name ] = $post_type->label;
    }

    if ( rcl_get_option( 'post_types_list' ) ) {
      foreach ( $types as $post_typen => $name ) {
        $find = array_search( $post_typen, rcl_get_option( 'post_types_list' ) );
        if ( $find === false ) {
          unset( $types[ $post_typen ] );
        }
      }
    }

    if ( $types ) {

      $tab_data = array(
        'id'       => 'publics',
        'name'     => ( 'Posts', 'wp-recall' ),
        'supports' => array( 'ajax', 'cache' ),
        'public'   => rcl_get_option( 'view_publics_block_rcl' ),
        'icon'     => 'fa-list',
        'output'   => 'menu',
        'content'  => array()
      );

      foreach ( $types as $post_type => $name ) {
        $tab_data['content'][] = array(
          'id'       => 'type-' . $post_type,
          'name'     => $name,
          'icon'     => 'fa-list',
          'callback' => array(
            'name' => 'rcl_get_postslist',
            'args' => array( $post_type, $name )
          )
        );
      }

      rcl_tab( $tab_data );
    }
  }

  if ( rcl_get_option( 'output_public_form_rcl' ) == 1 ) {

    rcl_tab(
      array(
        'id'      => 'postform',
        'name'    => __( 'Publication', 'wp-recall' ),
        'public'  => 0,
        'icon'    => 'fa-pencil',
        'content' => array(
          array(
            'callback' => array(
              'name' => 'rcl_tab_postform'
            )
          )
        )
      )
    );
  }
}

Вы не имеете права на публикацию сообщений в этой теме
Авторизация

Good Webmaster

*
*
Генерация пароля

Good Webmaster