Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Otshelnik-Fm committed Oct 5, 2020
1 parent 95ac529 commit 61e16d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 5 additions & 4 deletions index.php
Expand Up @@ -28,18 +28,19 @@ function wmnm_field_sex_profile( $fields ) {
}

// и немного обрежем там что не надо
add_filter( 'rcl_custom_field_options', 'wmnm_exclude_variations', 10, 3 );
function wmnm_exclude_variations( $options, $field, $post_type ) {
add_filter( 'rcl_field_options', 'wmnm_exclude_variations', 10, 3 );
function wmnm_exclude_variations( $options, $field, $manager_id ) {
// это не страница "поля профиля"
if ( $post_type !== 'profile' )
if ( $manager_id !== 'profile' )
return $options;

// это не наше поле
if ( isset( $field['slug'] ) && ( $field['slug'] !== 'rcl_sex' ) )
if ( isset( $field->slug ) && ( $field->slug !== 'rcl_sex' ) )
return $options;

// что нам не нужно - удалим
foreach ( $options as $option ) {

// первое значение
if ( $option['slug'] == 'empty-first' )
continue;
Expand Down
4 changes: 2 additions & 2 deletions info.txt
@@ -1,6 +1,6 @@
Name: Woman Man;
Version: 1.0.1;
Support Core: 16.17.0;
Version: 1.1.0;
Support Core: 16.24.11;
Description: В личном кабинете дает возможность выбрать пол пользователя;
Author: Владимир Дружаев (Otshelnik-Fm);
Author URI: https://otshelnik-fm.ru/?utm_source=free-addons&utm_medium=addon-manager&utm_campaign=woman-man&utm_content=not-domain&utm_term=home-page;
Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Expand Up @@ -46,6 +46,11 @@


== Changelog ==
= 2020-10-05 =
v1.1
* поддержка WP-Recall 16.24.11


= 2019-06-25 =
v1.0.1
* Для wp-cron задачи можно применять <code>user_id = -1</code> - тогда функция <code>rcl_decline_by_sex()</code> вернет корректное значение по дефолту.
Expand Down

0 comments on commit 61e16d7

Please sign in to comment.