���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC readme.txt000064400000024034146726725200006560 0ustar00=== Smart Custom Fields === Contributors: inc2734, toro_unit, mimosafa, hideokamoto, hisako-isaka, kurudrive, hanamura, justinticktock, designhehe, mayukojpn, hogetan, robssanches, mirucon, sysbird, kengyu-nakamura, fuyuan9 Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40 Tags: plugin, custom field, custom, field, meta, meta field, repeat, repeatable Requires at least: 6.4 Requires PHP: 7.4 Tested up to: 6.4 Stable tag: 5.0.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Smart Custom Fields is a simple plugin for managing custom fields. == Description == Smart Custom Fields is a simple plugin for managing custom fields. = Features = * Field group loop support. * Meta data revision support. * Meta data preview support. https://www.youtube.com/watch?v=WxPZurn0yvI = Field Types = * Text * Textarea * Radio * Select * Checkbox * WYSIWYG editor * Image * File * Related Posts * Related Terms * Color picker * Date picker * Datetime picker * Boolean * Message = How to get meta data ? = **Post meta data** This method can get any meta data. `SCF::get( 'field-name' )` This method can get meta data of any group. `SCF::get( 'group-name' )` This method can get all meta data. `SCF::gets()` **User meta data** This method can get any user meta data. `SCF::get_user_meta( $user_id, 'field-name' )` This method can get user meta data of any group. `SCF::get_user_meta( $user_id, 'group-name' )` This method can get all user meta data. `SCF::get_user_meta( $user_id )` **Term meta data** This method can get any term meta data. `SCF::get_term_meta( $term_id, $taxonomy 'field-name' )` This method can get term meta data of any group. `SCF::get_term_meta( $term_id, $taxonomy, 'group-name' )` This method can get all term meta data. `SCF::get_term_meta( $term_id, $taxonomy )` **Custom options page meta data** This method can get any custom options page meta data. `SCF::get_option_meta( $menu_slug, 'field-name' )` This method can get custom options page meta data of any group. `SCF::get_option_meta( $menu_slug, 'group-name' )` This method can get all custom options page meta data. `SCF::get_option_meta( $menu_slug )` = Create custom options page = `SCF::add_options_page( $page_title, $menu_title, $capability, $menu_slug, $icon_url = '', $position = null );` = Register custom fields by the code. = https://gist.github.com/inc2734/9f6d65c7473d060d0fd6 = GitHub = https://github.com/inc2734/smart-custom-fields/ = Translators = * Japanese(ja) - [JOTAKI Taisuke](https://profiles.wordpress.org/tai/) You can translate this plugin into your language by using [GlotPress](https://translate.wordpress.org/projects/wp-plugins/smart-custom-fields). == Installation == 1. Upload `Smart Custom Fields` to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress 1. You can setting custom fields in 'Smart Custom Fields' page. == Screenshots == 1. Smart Custom Fields settings page. 2. Post edit page. == Changelog == = 5.0.0 = * WordPress 6.4 or higher is now required. * PHP 7.4 or higher is now required. * Security fix. = 4.2.2 = * Fix fatal error that occurred when using with bogo. = 4.2.1 = * Fix Worning/Fatal error on PHP7/8. * Fix sanitize missing in the textarea field. * Add list to the wysiwyg field. = 4.1.6 * Some updates by [@kengyu](https://github.com/kengyu) * Add filter hook smart-cf-rest_api_post_type by [@fuyuan9](https://github.com/fuyuan9) = 4.1.5 = * Fix ajax bug. = 4.1.4 = * WordPress 5.5 support * Changed so that the reusable block post type is not displayed in the conditional judgment. = 4.1.3 = * Activate datetimepicker in repeat group #80 = 4.1.2 = * Fix PHP syntax error. = 4.1.0 = * feat: Implement new field datetime picker * feat: Add filters for related posts fields with name and post types = 4.0.2 = * Some updates by [@robssanches](https://github.com/robssanches) = 4.0.0 = * Add message field. #64 (by [@robssanches](https://github.com/robssanches)) * Fix boolean field bug with `smart-cf-register-fields` filter hook. * Refactoring displaying options process of each fields. = 3.1.7 = * Fixing issues and adding support for the Brazilian Portuguese language #63 (by [@robssanches](https://github.com/robssanches)) * Spelling fixes in Readme #62 (by [@garrett-eclipse](https://github.com/garrett-eclipse)) = 3.1.6 = * Set any on related post status. #60 (by [@mayukojpn](https://github.com/mayukojpn)) * Changed that file names can be known when uploading files. #58 (by [@shodoi](https://github.com/shodoi)) = 3.1.5 = * Fixed a bug that disappeared layout when introducing description in relation field. #56 (by [@mayukojpn](https://github.com/mayukojpn)) * Update item delete button style in relation field. * Fix bug when using smart-cf-register-fields hook. = 3.1.4 = * Remove no used codes. * Fixed a bug that name disappears when opening / closing a field. #51 (by [@yousan](https://github.com/yousan)) = 3.1.3 = * Fix Selectable number bug = 3.1.2 = * Update readme.txt = 3.1.1 = * Fixed a bug of limit attribute at relation post types and taxonomies field. = 3.1.0 = * Added limit attribute at relation post types and taxonomies field. = 3.0.1 = * Fixed a bug that icon and display position of created option page are not reflected #47 (by [@designhehe](https://github.com/designhehe)) = 3.0.0 = * Support multiple user roles. * Update filter hook smart-cf-register-fields = 2.3.0 = * Support displayed thumbnail when value of file and image field is file url. = 2.2.3 = * Fix get_post_metadata hooked only preview #43 (by [@wireframeslayout](https://github.com/wireframeslayout)) = 2.2.2 = * Fix #37 #38 = 2.2.1 = * Fix bug boolean field in repeatable group #39 * Fix bug datepicker and colorpicker in repeatable group #41 = 2.2.0 = * Refactoring tests. * Changed behavior of the default value of new field of the already saved object. Using the default value. = 2.1.1 = * Fix revision lines duplication (by [@hanamura](https://github.com/hanamura)) * Fixed a bug that relation fields don't work on the options page. = 2.1.0 = * Support separated key and value in select, checkbox, radio. * Added switching editor mode tab in wysiwyg field. * Added instruction of field option. = 2.0.0 = * Refactoring * Added meta data of custom options page. = 1.7.0 = * Added taxonomy relation field. * Added textarea rows setting. * Fixed a bug that tinymce js error when disabled rich editing. = 1.6.7 = * Removed console.log in a js file. = 1.6.6 = * Fixed a bug that warning is out when the array isn't returned in the smart-cf-register-fields. = 1.6.5 = * Fixed a bug that multi value in the loop is broken. * In setting screen, if the field is closed, display the field name. = 1.6.4 = * Fixed a bug that wysiwyg fields became tinymce default format when content editor mode is text. * Change the comment in English. = 1.6.3 = * Fixed a bug that metadata that isn't defined by Smart Custom Fields can't get in preview. = 1.6.2 = * Fixed a bug that sometimes can't get data when there are multiple Smart Custom Fields settings. = 1.6.1 = * Fixed a bug that custom field settings vanished when saved. = 1.6.0 = * Added search feature in the relation field. * Changed when the object isn't saved, default value is active. * Remove filter hook smart-cf-is_use_default_when_not_saved. * Fixed a bug that isn't displayed meta data in preview when using custom fields settings with post id. = 1.5.3 = * Fixed a wysiwyg field bug. = 1.5.2 = * Fixed a wysiwyg field bug. = 1.5.1 = * Fixed a relation field bug. = 1.5.0 = * Update wysiwyg field. = 1.4.0 = * refactoring controllers. * Add term custom fields. * Add filter hook smart-cf-is_use_default_when_not_saved * Changed to the default value is used if the value has not been saved. If you want to revert to the previous behavior, return false in smart-cf-is_use_default_when_not_saved. = 1.3.2 = * Add preview size setting in the image field. * Add display direction setting in the checkbox and radio field. * Changed the upload field that displayed uploaded to this post first. = 1.3.1 = * Fixed a wysiwyg field bug. * Add boolean field. = 1.3.0 = * refactoring. * Add profile custom fields. * Add filter hook smart-cf-validate-get-value * Add method SCF::get_user_meta( $user_id, $name = null ) * Fixed a revision bug. * Fixed a bug that thumbnail is not displayed correctly in preview. * Fixed a relation field bug. * Changed return value of SCF::get with multiple data in loop. * Changed revision screen format. = 1.2.2 = * Fixed a bug that can not get the correct data when the posts use post id filtering. * Changed that original the_content filter does not apply to wysiwyg field. * Add post_id attribute to smart-cf-register-fields. = 1.2.1 = * Fixed a bug that post id filtering incorrect. = 1.2.0 = * refactoring. A lot of changes in all. * Renewed the Smart_Custom_Fields_Field_Base. * Add filter hook smart-cf-register-fields. If You use this hook, you can define custom fields by the code. * Add action hook smart-cf-before-editor-enqueue-scripts * Add action hook smart-cf-after-editor-enqueue-scripts * Add action hook smart-cf-before-settings-enqueue-scripts * Add action hook smart-cf-after-settings-enqueue-scripts = 1.1.3 = * Change method SCF::get_field to SCF::get_value_by_field * Change method SCF::get_sub_field to SCF::get_values_by_group * Add method SCF::get_field * Add method SCF::choices_eol_to_array * remove method Smart_Custom_Fields_Field_Base::get_choices = 1.1.2 = * Add action hook smart-cf-fields-loaded = 1.1.1 = * UX Improvement of settings page. = 1.1.0 = * Add date picker field. = 1.0.3 = * Fixed a bug that can't be get the correct data when specify a $post_id attribute to SCF::get(). For example SCF::get( 'key', $post_id ) = 1.0.2 = * Add color picker field. * Add smart-cf-before-save-post action hook. * Add smart-cf-after-save-post action hook. * Add smart-cf-validate-save-post filter hook. = 1.0.1 = * Add display condition by post id. * Fixed bug that is not displayed wysiwyg editor when there are not content editor. * Textarea does not filter the_content filter in SCF::get() and SCF::gets(). = 1.0.0 = * Initial release. js/settings.js000064400000023720146726725200007375 0ustar00jQuery( function( $ ) { $( '.smart-cf-fields-wrapper' ).each( function( i, e ) { var wrapper = $( e ); var btn_add_group = wrapper.find( '.btn-add-group' ); var btn_remove_group = wrapper.find( '.btn-remove-group' ); var btn_add_field = wrapper.find( '.btn-add-field' ); var btn_remove_field = wrapper.find( '.btn-remove-field' ); var group_class = '.smart-cf-group'; var field_class = '.smart-cf-field'; var duplicate_alert_class = '.smart-cf-duplicate-alert'; var options = wrapper.find( '.smart-cf-field-options' ); var cnt = wrapper.find( field_class ).length; /** * 重複エラーメッセージ表示 & 重複時の更新不可 */ wrapper.find( 'input[class="smart-cf-group-name"], input[class="smart-cf-field-name"]' ).keyup( function() { var val = $( this ).val(); var cnt = 0; wrapper.find( 'input[class="smart-cf-group-name"], input[class="smart-cf-field-name"]' ).each( function( i, e ) { if ( val === $( this ).val() && val !== '' ) { cnt ++; } } ); if ( cnt > 1 ) { if ( $( this ).siblings( duplicate_alert_class ).length < 1 ) { $( this ).after( $( '
' ) .addClass( duplicate_alert_class.replace( '.', '' ) ) .text( smart_cf_settings.duplicate_alert ) ); } cnt = 0; } else { $( this ).siblings( duplicate_alert_class ).remove(); } if ( $( duplicate_alert_class ).length ) { $( '#publish' ).attr( 'disabled', 'disabled' ); } else { $( '#publish' ).removeAttr( 'disabled' ); } } ); /** * sortable */ $( '.smart-cf-groups' ).sortable( { cursor: 'move', handle: '.smart-cf-icon-handle' } ); $( '.smart-cf-fields' ).sortable( { cursor: 'move', handle: '.smart-cf-icon-handle' } ); /** * フィールドの開閉 */ $( '.field-label' ).click( function() { var field_label = $( this ); var table = $( this ).parents( field_class ).find( 'table' ); if ( table.hasClass( 'hide' ) ) { field_label.html( " " ); table.fadeIn( 'fast', function() { $( this ).removeClass( 'hide' ); table.find( '.smart-cf-field-options' ).each( function( i, e ) { $( this ).trigger( 'smart-cf-setting-field-open', e ); } ); } ); } else { var field_options = table.find( '.smart-cf-field-options:visible' ); var label = field_options.find( '.smart-cf-field-label' ).val(); var name = $( '' ).text( '[ ' + field_options.find('.smart-cf-field-name').val() + ' ]' ); if ( !label ) { label = field_options.find( '.smart-cf-field-name' ).val(); } table.fadeOut( 'fast', function() { $( this ).addClass( 'hide' ); field_label.text( label + " " ).append( name ); } ); } } ); /** * グループ追加ボタン */ btn_add_group.click( function() { cnt ++; var group = wrapper.find( group_class ); var group_clone = group.first().clone( true, true ); group.last().after( group_clone.fadeIn( 'fast', function() { $( this ).removeClass( 'hide' ); } ) ); var field = group_clone.find( field_class ); var field_clone = field.first().clone( true, true ); field.last().after( field_clone.removeClass( 'hide' ) ); group_clone.find( 'input, select, textarea' ).each( function( i, e ) { $( this ).attr( 'name', $( this ).attr( 'name' ).replace( /^(smart-custom-fields)\[\d+\]/, '$1[' + cnt + ']' ) ); } ); field_clone.find( 'input, select, textarea' ).each( function( i, e ) { $( this ).attr( 'name', $( this ).attr( 'name' ).replace( /^(smart-custom-fields)\[.+?\](\[fields\])\[\d+?\]/, '$1[' + cnt + ']$2[' + cnt + ']' ) ); } ); } ); /** * グループ削除ボタン */ btn_remove_group.click( function() { $( this ).parents( group_class ).fadeOut( 'fast', function() { $( this ).remove(); } ); } ); /** * フィールド追加ボタン */ btn_add_field.click( function() { cnt ++; var group = $( this ).parents( group_class ); var field = group.find( field_class ); var clone = field.first().clone( true, true ); field.last().after( clone.fadeIn( 'fast', function() { $( this ).removeClass( 'hide' ); } ) ); clone.find( 'input, select, textarea' ).each( function( i, e ) { $( this ).attr( 'name', $( this ).attr( 'name' ).replace( /^(smart-custom-fields\[.+?\]\[fields\])\[\d+?\]/, '$1[' + cnt + ']' ) ); } ); } ); /** * フィールド削除ボタン */ btn_remove_field.click( function() { $( this ).parents( field_class ).fadeOut( 'fast', function() { $( this ).remove(); } ); } ); /** * 選択項目オプション */ options.find( 'input, textarea, select' ).attr( 'disabled', 'disabled' ); wrapper.find( '.smart-cf-field-select' ).each( function( i, e ) { var selected_type = $( this ).val(); $( this ).parents( field_class ).find( '.smart-cf-field-options-' + selected_type ) .removeClass( 'hide' ) .find( 'input, textarea, select' ).removeAttr( 'disabled' ); } ); wrapper.find( '.smart-cf-field-select' ).change( function() { var field = $( this ).parents( field_class ); var val = $( this ).val(); var hide_options = field.find( '.smart-cf-field-options' ); hide_options.addClass( 'hide' ); hide_options.find( 'input, textarea, select' ).attr( 'disabled', 'disabled' ); var show_options = field.find( '.smart-cf-field-options-' + val ); show_options.find( 'input, textarea, select' ).removeAttr( 'disabled' ); show_options.removeClass( 'hide' ); show_options.trigger( 'smart-cf-setting-show-options', show_options ); } ); /** * リピートボタンクリック時 */ wrapper.find( '.smart-cf-group-repeat input' ).click( function() { var group = $( this ).parents( group_class ); var names = group.find( '.smart-cf-group-names' ); var btn_add_field = group.find( '.btn-add-field' ); if ( $( this ).prop( 'checked' ) ) { names.removeClass( 'hide' ); btn_add_field.removeClass( 'hide' ); } else { names.addClass( 'hide' ); btn_add_field.addClass( 'hide' ); } } ); /** * Convert string to slug * https://gist.github.com/codeguy/6684588 */ function string_to_slug(str) { str = str.replace(/^\s+|\s+$/g, ""); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "åàáãäâèéëêìíïîòóöôùúüûñç·/-,:;"; var to = "aaaaaaeeeeiiiioooouuuunc______"; for (var i = 0, l = from.length; i < l; i++) { str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i)); } str = str .replace(/[^a-z0-9 -]/g, "") // remove invalid chars .replace(/\s+/g, "_") // collapse whitespace and replace by - .replace(/-+/g, "_"); // collapse dashes return str; } /** * フィールド名入力ボックス */ wrapper.find( '.smart-cf-field-name' ).focus( function() { var field = $( this ).parents( '.smart-cf-field-options' ); var label_val = field.find( '.smart-cf-field-label' ).val(); var name_val = $( this ).val(); if ( label_val && !name_val) { $( this ).val( string_to_slug(label_val) ); } } ); } ); /** * Add autocomplete (selectivity plguin) in posts condition field * https://github.com/arendjr/selectivity */ $('#smart-cf-autocomplete-condition-post').selectivity({ data: smart_cf_saved_posts, multiple: true, placeholder: smart_cf_settings.autocomplete_placeholder, ajax: { url: smart_cf_settings.rest_api_url, quietMillis: 200, params: function(term, offset) { return { _wpnonce: smart_cf_settings.nonce, }; }, }, templates: { multipleSelectInput: function(options) { return ( '
' + (options.enabled ? '' : '
') + '
' + '
' ); }, multipleSelectedItem: function(options) { var extraClass = options.highlighted ? ' highlighted' : ''; return ( '' + (options.removable ? '' + 'x' + '' : '') + options.id + '' ); //options.text }, dropdown: function(options) { var extraClass = options.dropdownCssClass ? ' ' + options.dropdownCssClass : '', searchInput = ''; if (options.showSearchInput) { extraClass += ' has-search-input'; var placeholder = options.searchInputPlaceholder; searchInput = '
' + '' + '
'; } return ( '
' + searchInput + '
' + '
' ); }, loading: function() { return '
' + smart_cf_settings.loading + '
'; }, loadMore: function() { return '
' + smart_cf_settings.load_more + '
'; }, } }); $('#smart-cf-autocomplete-condition-post').on('change', function() { var data = $(this).selectivity('value'); $('[name="smart-cf-condition-post-ids"]').val(data); }); /** * Add IOS style for checkboxes */ $('.smart-cf-group .smart-cf-group-repeat label, #smart-cf-meta-box-condition-post, #smart-cf-meta-box-condition-profile, #smart-cf-meta-box-condition-taxonomy, #smart-cf-meta-box-condition-options-page') .find('input[type=checkbox]') .iosCheckbox(); } ); js/settings-datetime-picker.js000064400000000446146726725200012442 0ustar00window.addEventListener('DOMContentLoaded', function() { var el = document.querySelector('.smart-cf-datetime_picker'); if (el) { var data = el.getAttribute('data-js'); data = JSON.parse(data); data['enableTime'] = true; } flatpickr('.smart-cf-datetime_picker', data); }); js/settings-colorpicker.js000064400000001051146726725200011700 0ustar00jQuery( function( $ ) { $( document ).on( 'smart-cf-setting-field-open', function( e, options ) { if ( $( options ).hasClass( 'smart-cf-field-options-colorpicker' ) ) { $( options ).find( '.default-option' ).each( function( i, e ) { $( e ).wpColorPicker(); } ); } } ); $( document ).on( 'smart-cf-setting-show-options', function( e, options ) { if ( $( options ).hasClass( 'smart-cf-field-options-colorpicker' ) ) { $( options ).find( '.default-option' ).each( function( i, e ) { $( e ).wpColorPicker(); } ); } } ); } ); js/editor-relation-common.js000064400000004071146726725200012122 0ustar00jQuery( function( $ ) { var table_class = 'tr'; /** * 選択肢 */ var choices_li = '.smart-cf-relation-children-select li'; $( '.smart-cf-meta-box' ).on( 'click', choices_li, function() { var id = $( this ).data( 'id' ); var parent = $( this ).closest( table_class ); var limit = parent.find( '.smart-cf-relation-left' ).data( 'limit' ); if ( limit > 0 && limit <= parent.find( '.smart-cf-relation-right li' ).length ) { return true; } if ( parent.find( '.smart-cf-relation-right li[data-id="' + id + '"]' ).length !== 0 ) { return true; } var clone = $( this ).clone(); clone .prepend( $( '' ) ) .append( $( '-' ) ); parent.find( '.smart-cf-relation-right ul' ).append( clone ); update_relation_value( $( this ).closest( 'tr' ) ); } ); /** * 選択済み項目の削除 */ var relation_remove = '.smart-cf-relation-right li .relation-remove'; $( '.smart-cf-meta-box' ).on( 'click', relation_remove, function() { var tr = $( this ).closest( 'tr' ); $( this ).parent().remove(); update_relation_value( tr ); } ); /** * update_relation_value * @param dom tr */ function update_relation_value( tr ) { var hidden = tr.find( 'input[type="hidden"]' ); hidden.each( function( i, e ) { if ( i !== 0 ) { $( this ).remove(); } } ); tr.find( '.smart-cf-relation-right li' ).each( function( i, e ) { var hidden_box = $( this ).closest( table_class ).find( '.smart-cf-relation-children-select' ); var id = $( this ).data( 'id' ); var clone = hidden.first().clone(); var name = clone.attr( 'name' ); clone.attr( 'name', name + '[]' ); clone.val( id ); hidden_box.append( clone ); } ); } /** * sortable */ $( '.smart-cf-meta-box' ).find( '.smart-cf-relation-right ul' ) .on( 'mousedown', function( event ) { event.stopPropagation(); } ) .sortable( { handle: '.smart-cf-icon-handle', update: function() { update_relation_value( $( this ).closest( 'tr' ) ); } } ); } ); js/editor-wysiwyg.js000064400000012063146726725200010541 0ustar00jQuery( function( $ ) { $( '.smart-cf-meta-box' ).each( function( i, e ) { var wrapper = $( e ); var table_class = '.smart-cf-meta-box-table'; /** * ロード時に wysiwyg エディター用のテキストエリアがあったら wysiwyg 化する。 */ wrapper.find( '.smart-cf-wp-editor' ).each( function( i, e ) { if ( $( this ).parents( table_class ).css( 'display' ) === 'none' ) { return true; } $( e ).attr( 'id', $( e ).attr( 'name' ).replace( /(\[|\]|\-)/ig, '_' ) ); var editor_id = $( e ).attr( 'id' ); var wrap = $( e ).parents( '.wp-editor-wrap' ); initialize_editor( wrap, editor_id ); var mceinit = scf_generate_mceinit( editor_id ); tinyMCEPreInit.mceInit[editor_id] = mceinit; if ( typeof tinymce !== 'undefined' ) { tinymce.init( mceinit ); } var qtinit = scf_generate_qtinit( editor_id ); tinyMCEPreInit.qtInit[editor_id] = qtinit; if ( typeof quicktags !== 'undefined' ) { quicktags( qtinit ); QTags._buttonsInit(); } } ); } ); /** * グループ追加ボタンを押したときに発火。 * wysiwyg エディター用のテキストエリアがあったら wysiwyg 化する。 */ $( document ).on( 'smart-cf-after-add-group', function( e, data ) { var button = data.button; var clone = data.clone; clone.find( '.smart-cf-wp-editor' ).each( function( i, e ) { $( e ).attr( 'id', $( e ).attr( 'name' ).replace( /(\[|\]|\-)/ig, '_' ) ); var editor_id = $( e ).attr( 'id' ); var wrap = $( e ).parents( '.wp-editor-wrap' ); initialize_editor( wrap, editor_id ); var mceinit = scf_generate_mceinit( editor_id ); tinyMCEPreInit.mceInit[editor_id] = mceinit; if ( typeof tinymce !== 'undefined' ) { tinymce.init( mceinit ); } var qtinit = scf_generate_qtinit( editor_id ); tinyMCEPreInit.qtInit[editor_id] = qtinit; if ( typeof quicktags !== 'undefined' ) { quicktags( qtinit ); QTags._buttonsInit(); } } ); } ); /** * ドラッグしたときに発火。 * wysiwyg エディター用のテキストエリアをオフる。 */ $( document ).on( 'smart-cf-repeat-table-sortable-start', function( e, ui ) { $( ui ).find( '.smart-cf-wp-editor' ).each( function( i, e ) { var editor_id = $( this ).attr( 'id' ); tinymce.execCommand( 'mceRemoveEditor', false, editor_id ); var mceinit = scf_generate_mceinit( editor_id ); tinyMCEPreInit.mceInit[editor_id] = mceinit; var qtinit = scf_generate_qtinit( editor_id ); tinyMCEPreInit.qtInit[editor_id] = qtinit; if ( typeof quicktags !== 'undefined' ) { quicktags( qtinit ); QTags._buttonsInit(); } } ); } ); /** * ドロップしたときに発火。 * wysiwyg エディター用のテキストエリアを wysiwyg 化する。 */ $( document ).on( 'smart-cf-repeat-table-sortable-stop', function( e, ui ) { $( ui ).find( '.smart-cf-wp-editor' ).each( function( i, e ) { var editor_id = $( this ).attr( 'id' ); var mceinit = scf_generate_mceinit( editor_id ); tinyMCEPreInit.mceInit[editor_id] = mceinit; if ( typeof tinymce !== 'undefined' ) { tinymce.init( mceinit ); } var qtinit = scf_generate_qtinit( editor_id ); tinyMCEPreInit.qtInit[editor_id] = qtinit; if ( typeof quicktags !== 'undefined' ) { quicktags( qtinit ); QTags._buttonsInit(); } } ); } ); function initialize_editor( wrap, editor_id ) { wrap.attr( 'id', 'wp-' + editor_id + '-wrap' ); wrap.find( 'a.add_media' ).attr( 'data-editor', editor_id ); wrap.find( '.switch-tmce' ) .attr( 'data-wp-editor-id', editor_id ) .attr( 'id', editor_id + '-tmce' ); wrap.find( '.switch-html' ) .attr( 'data-wp-editor-id', editor_id ) .attr( 'id', editor_id + '-html' ); wrap.find( '.quicktags-toolbar' ).attr( 'id', 'qt_' + editor_id + '_toolbar' ); } function scf_generate_mceinit( editor_id ) { var mceinit; if ( typeof tinyMCEPreInit.mceInit.content !== 'undefined' ) { mceinit = $.extend( true, {}, tinyMCEPreInit.mceInit.content ); mceinit.selector = '#' + editor_id; } else { mceinit = { content_css: ['../wp-includes/js/tinymce/skins/wordpress/wp-content.css', '../wp-content/plugins/smart-custom-fields/css/wysiwyg.css'], menubar: false, plugins: "hr,wplink,fullscreen,wordpress,textcolor,paste,charmap,lists", toolbar1: "bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,wp_adv,fullscreen", toolbar2: "formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help,code", convert_urls: false, theme: "modern", skin: "lightgray", wp_autoresize_on: true, wpautop: true, selector: '#' + editor_id }; } return mceinit; } function scf_generate_qtinit( editor_id ) { var qtinit; if ( typeof tinyMCEPreInit.qtInit.content !== 'undefined' ) { qtinit = $.extend( true, {}, tinyMCEPreInit.qtInit.content ); qtinit.id = editor_id; } else { qtinit = { id: editor_id, buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close" } } return qtinit; } } ); js/settings-datepicker.js000064400000001113146726725200011476 0ustar00jQuery( function( $ ) { $( document ).on( 'smart-cf-setting-field-open', function( e, options ) { if ( $( options ).hasClass( 'smart-cf-field-options-datepicker' ) ) { $( options ).find( '.default-option' ).each( function( i, e ) { $( e ).datepicker( $( e ).data( 'js' ) ); } ); } } ); $( document ).on( 'smart-cf-setting-show-options', function( e, options ) { if ( $( options ).hasClass( 'smart-cf-field-options-datepicker' ) ) { $( options ).find( '.default-option' ).each( function( i, e ) { $( e ).datepicker( $( e ).data( 'js' ) ); } ); } } ); } ); js/editor-relation-post-types.js000064400000005103146726725200012756 0ustar00jQuery( function( $ ) { var table_class = 'tr'; /** * 初期化 * click_count はロードボタンを押すごとに加算。 * 検索ボックスが変更されるたびに 0 にリセットすること。 */ $( '.smart-cf-meta-box .load-relation-post-types' ).closest( table_class ) .data( 'click_count', 0 ) .data( 'search_timer', null ) .data( 'recent_search_query', '' ); /** * 検索ボタン */ $( document ).on( 'keyup', '.smart-cf-meta-box .search-input-post-types', function() { var parent = $( this ).closest( table_class ); var search_timer = parent.data( 'search_timer' ); clearTimeout( search_timer ); parent.data( 'click_count', 0 ); parent.find( '.smart-cf-relation-children-select ul li' ).remove(); var search_query = $( this ).val(); parent.data( 'recent_search_query', search_query ); parent.data( 'search_timer', setTimeout( function() { get_posts( { s: search_query }, parent ); }, 2000 ) ); } ); /** * 読み込みボタン */ $( document ).on( 'click', '.smart-cf-meta-box .load-relation-post-types', function() { var parent = $( this ).closest( table_class ); var click_count = parent.data( 'click_count' ); click_count ++; parent.data( 'click_count', click_count ); var search_query = parent.data( 'recent_search_query' ); if ( search_query ) { get_posts( { s: search_query }, parent ); } else { get_posts( {}, parent ); } } ); /** * クエリ */ function get_posts( args, table ) { var click_count = table.data( 'click_count' ); var post_types = table.find( '.smart-cf-relation-left' ).data( 'post-types' ); var btn_load = table.find( '.load-relation-post-types' ); var btn_load_text = btn_load.text(); btn_load.text( 'Now loading...' ); var nameEl = document.getElementById('smart-cf-field-name-data'); var name = ''; if (nameEl) { name = nameEl.getAttribute('data-js'); } args = $.extend( args, { action : smart_cf_relation_post_types.action, nonce : smart_cf_relation_post_types.nonce, click_count: click_count, post_types : post_types, field_name: name } ); $.post( smart_cf_relation_post_types.endpoint, args, function( response ) { btn_load.addClass( 'hide' ); $( response ).each( function( i, e ) { table.find( '.smart-cf-relation-children-select ul' ).append( $( '
  • ' ) .attr( 'data-id', this.ID ) .attr( 'data-status', this.post_status ) .text( this.post_title ) ); } ); btn_load.text( btn_load_text ); btn_load.removeClass( 'hide' ); } ); return false; } } ); js/editor.js000064400000013615146726725200007025 0ustar00jQuery( function( $ ) { $( '.smart-cf-meta-box' ).each( function( i, e ) { var wrapper = $( e ); var btn_add_repeat_group = wrapper.find( '.btn-add-repeat-group' ); var btn_remove_repeat_group = wrapper.find( '.btn-remove-repeat-group' ); var table_class = '.smart-cf-meta-box-table'; var cnt = wrapper.find( table_class ).length; /** * グループ追加ボタン */ btn_add_repeat_group.click( function( e ) { cnt ++; var parent = $( this ).parents( '.smart-cf-meta-box-repeat-tables' ); add_repeat_group( $( this ) ); } ); /** * グループ削除ボタン */ btn_remove_repeat_group.click( function() { var table = $( this ).parents( table_class ); table.fadeOut( 'fast', function() { $( this ).remove(); } ); var tables = $( this ).parents( '.smart-cf-meta-box-repeat-tables' ); if ( tables.find( table_class ).length === 2 ) { cnt ++; add_repeat_group( $( this ) ); } } ); function add_repeat_group( button ) { var tables = button.parents( '.smart-cf-meta-box-repeat-tables' ); var table = tables.find( table_class ).first(); var clone = table.clone( true, true ).hide(); clone.find( 'input, select, textarea' ).each( function( i, e ) { var name = $( this ).attr( 'name' ); if ( name ) { $( this ).attr( 'name', name.replace( /^(smart-custom-fields\[.+?\])\[\]/, '$1[' + cnt + ']' ) ); $( this ).removeAttr( 'disabled' ); } } ); clone.find( '.smart-cf-datetime_picker' ).addClass( 'add' ); button.parent().after( clone.fadeIn( 'fast' ) ); button.trigger( 'smart-cf-after-add-group', { button: button, clone: clone} ); } /** * 画像アップローダー */ wrapper.find( '.btn-add-image' ).click( function( e ) { e.preventDefault(); var custom_uploader_image; var upload_button = $( this ); if ( custom_uploader_image ) { custom_uploader_image.open(); return; } wp.media.view.Modal.prototype.on( 'ready', function(){ $( 'select.attachment-filters' ) .find( '[value="uploaded"]' ) .attr( 'selected', true ) .parent() .trigger( 'change' ); } ); custom_uploader_image = wp.media( { button : { text: smart_cf_uploader.image_uploader_title }, states: [ new wp.media.controller.Library({ title : smart_cf_uploader.image_uploader_title, library : wp.media.query( { type: 'image' } ), multiple : false, filterable: 'uploaded' }) ] } ); custom_uploader_image.on( 'select', function() { var images = custom_uploader_image.state().get( 'selection' ); images.each( function( file ){ var sizes = file.get('sizes'); var image_area = upload_button.parent().find( '.smart-cf-upload-image' ); var sizename = image_area.data('size'); var img = sizes[ sizename ] || sizes.full; var alt_attr = file.get('title'); image_area.find( 'img' ).remove(); image_area.prepend( '' + alt_attr + '' ); image_area.removeClass( 'hide' ); upload_button.parent().find( 'input[type="hidden"]' ).val( file.toJSON().id ); } ); } ); custom_uploader_image.open(); } ); /** * 画像削除ボタン */ wrapper.find( '.smart-cf-upload-image' ).hover( function() { $( this ).find( '.btn-remove-image' ).fadeIn( 'fast', function() { $( this ).removeClass( 'hide' ); } ); }, function() { $( this ).find( '.btn-remove-image' ).fadeOut( 'fast', function() { $( this ).addClass( 'hide' ); } ); } ); wrapper.find( '.btn-remove-image' ).click( function() { $( this ).parent().find( 'img' ).remove(); $( this ).parent().siblings( 'input[type="hidden"]' ).val( '' ); $( this ).parent().addClass( 'hide' ); } ); /** * ファイルアップローダー */ wrapper.find( '.btn-add-file' ).click( function( e ) { e.preventDefault(); var custom_uploader_file; var upload_button = $( this ); if ( custom_uploader_file ) { custom_uploader_file.open(); return; } custom_uploader_file = wp.media( { title : smart_cf_uploader.file_uploader_title, button: { text: smart_cf_uploader.file_uploader_title }, multiple: false } ); custom_uploader_file.on( 'select', function() { var images = custom_uploader_file.state().get( 'selection' ); images.each( function( file ){ var image_area = upload_button.parent().find( '.smart-cf-upload-file' ); var alt_attr = file.get('title'); image_area.find( 'a' ).remove(); image_area.prepend( '' + alt_attr + '' + file.toJSON().filename + '' ); image_area.removeClass( 'hide' ); upload_button.parent().find( 'input[type="hidden"]' ).val( file.toJSON().id ); } ); } ); custom_uploader_file.open(); } ); /** * ファイル削除ボタン */ wrapper.find( '.smart-cf-upload-file' ).hover( function() { $( this ).find( '.btn-remove-file' ).fadeIn( 'fast', function() { $( this ).removeClass( 'hide' ); } ); }, function() { $( this ).find( '.btn-remove-file' ).fadeOut( 'fast', function() { $( this ).addClass( 'hide' ); } ); } ); wrapper.find( '.btn-remove-file' ).click( function() { $( this ).parent().find( 'img' ).remove(); $( this ).parent().siblings( 'input[type="hidden"]' ).val( '' ); $( this ).parent().addClass( 'hide' ); } ); /** * sortable */ wrapper.find( '.smart-cf-meta-box-repeat-tables' ).sortable( { handle: '.smart-cf-icon-handle', items : '> .smart-cf-meta-box-table:not( :first-child )', start : function( e, ui ) { $( this ).trigger( 'smart-cf-repeat-table-sortable-start', ui.item ); }, stop : function( e, ui ) { $( this ).trigger( 'smart-cf-repeat-table-sortable-stop', ui.item ); }, } ); } ); } ); js/editor-colorpicker.js000064400000001064146726725200011332 0ustar00jQuery( function( $ ) { $( '.smart-cf-meta-box-table' ).each( function( i, e ) { $( e ).find( '.smart-cf-colorpicker' ).each( function( i, e ) { if ( $( e ).attr( 'disabled' ) !== 'disabled' ) { $( e ).wpColorPicker(); } } ); } ); $( document ).on( 'smart-cf-after-add-group', function( e, obj ) { var parent = $( obj.button ).parents( '.smart-cf-meta-box-repeat-tables' ); parent.find( '.smart-cf-colorpicker' ).each( function( i, e ) { if ( $( e ).attr( 'disabled' ) !== 'disabled' ) { $( e ).wpColorPicker(); } } ); } ); } ); js/editor-datepicker.js000064400000001505146726725200011131 0ustar00jQuery( function( $ ) { $( '.smart-cf-meta-box-table' ).each( function( i, e ) { $( e ).find( '.smart-cf-datepicker' ).each( function( i, e ) { if ( $( e ).attr( 'disabled' ) !== 'disabled' ) { $( e ).datepicker( $( e ).data( 'js' ) ); } } ); } ); $( document ).on( 'smart-cf-after-add-group', function( e, obj ) { var parent = $( obj.button ).parents( '.smart-cf-meta-box-repeat-tables' ); parent.find( '.smart-cf-datepicker' ).each( function( i, e ) { if ( $( e ).attr( 'disabled' ) !== 'disabled' ) { $( e ).datepicker( $( e ).data( 'js' ) ); } } ); $( '.smart-cf-datetime_picker.add' ).each( function ( i, e ) { var data = e.getAttribute( 'data-js' ); data = JSON.parse( data ); data['enableTime'] = true; flatpickr( this, data ); $( this ).removeClass( 'add' ); } ); } ); } ); js/yoast-seo-analysis.js000064400000005746146726725200011311 0ustar00jQuery( function( $ ) { $(document).ready(function(e) { // if is Page or Post continue... if( $('body').hasClass('post-php') && typeof YoastSEO !== "undefined" && typeof SCFYoastSEOAnalysis == "undefined" ){ /** * Set up the SCF Yoast SEO Analysis plugin */ var SCFYoastSEOAnalysis = function() { console.log('SCFYoastSEOAnalysis'); YoastSEO.app.registerPlugin('SCFYoastSEOAnalysis', {status: 'ready'}); /** * @param modification {string} The name of the filter * @param callable {function} The callable * @param pluginName {string} The plugin that is registering the modification. * @param priority {number} (optional) Used to specify the order in which the callables * associated with a particular filter are called. Lower numbers * correspond with earlier execution. */ YoastSEO.app.registerModification('content', this.addScfFieldsToContent, 'SCFYoastSEOAnalysis', 5); this.analysisTimeout = 0; this.bindListeners(); // Re-analyse SEO score $('.btn-add-repeat-group, .btn-remove-image').on('click', this.bindListeners); if (wp.media) wp.media.view.Modal.prototype.on('close', function() { window.setTimeout( function() { YoastSEO.app.pluginReloaded('SCFYoastSEOAnalysis'); }, 200 ); }); }; /** * Bind listeners to text fields (input, textarea and wysiwyg) */ SCFYoastSEOAnalysis.prototype.bindListeners = function() { console.log('bindListeners'); SCFYoastSEOAnalysis.analysisTimeout = window.setTimeout( function() { YoastSEO.app.pluginReloaded('SCFYoastSEOAnalysis'); }, 200 ); $('#post-body, #edittag').find('input[type="text"][name^="smart-custom-fields"], textarea[name^="smart-custom-fields"], .smart-cf-field-type-wysiwyg iframe body#tinymce').on('keyup paste cut blur focus change', function() { if ( SCFYoastSEOAnalysis.analysisTimeout ) { window.clearTimeout(SCFYoastSEOAnalysis.analysisTimeout); } }); }; /** * Adds some text to the data... * * @param data The data to modify */ SCFYoastSEOAnalysis.prototype.addScfFieldsToContent = function(data) { console.log('addScfFieldsToContent'); var scf_content = ' '; $('#post-body, #edittag').find('input[type="text"][name^="smart-custom-fields"], textarea[name^="smart-custom-fields"]').each(function() { scf_content += ' ' + $(this).val(); }); $(".smart-cf-field-type-wysiwyg iframe").contents().find("body#tinymce").each(function() { scf_content += ' ' + $(this).html(); }); $('#post-body, #edittag').find('.smart-cf-upload-image img').each(function() { scf_content += '' + $(this).attr('alt') + ''; }); data = data + scf_content; return data.trim(); }; new SCFYoastSEOAnalysis(); } }); }); js/editor-relation-taxonomies.js000064400000004537146726725200013027 0ustar00jQuery( function( $ ) { var table_class = 'tr'; /** * 初期化 * click_count はロードボタンを押すごとに加算。 * 検索ボックスが変更されるたびに 0 にリセットすること。 */ $( '.smart-cf-meta-box .load-relation-terms' ).closest( table_class ) .data( 'click_count', 0 ) .data( 'search_timer', null ) .data( 'recent_search_query', '' ); /** * 検索ボタン */ $( document ).on( 'keyup', '.smart-cf-meta-box .search-input-terms', function() { var parent = $( this ).closest( table_class ); var search_timer = parent.data( 'search_timer' ); clearTimeout( search_timer ); parent.data( 'click_count', 0 ); parent.find( '.smart-cf-relation-children-select ul li' ).remove(); var search_query = $( this ).val(); parent.data( 'recent_search_query', search_query ); parent.data( 'search_timer', setTimeout( function() { get_terms( { search: search_query }, parent ); }, 2000 ) ); } ); /** * 読み込みボタン */ $( document ).on( 'click', '.smart-cf-meta-box .load-relation-terms', function() { var parent = $( this ).closest( table_class ); var click_count = parent.data( 'click_count' ); click_count ++; parent.data( 'click_count', click_count ); var search_query = parent.data( 'recent_search_query' ); if ( search_query ) { get_terms( { search: search_query }, parent ); } else { get_terms( {}, parent ); } } ); /** * クエリ */ function get_terms( args, table ) { var click_count = table.data( 'click_count' ); var taxonomies = table.find( '.smart-cf-relation-left' ).data( 'taxonomies' ); var btn_load = table.find( '.load-relation-terms' ); var btn_load_text = btn_load.text(); btn_load.text( 'Now loading...' ); args = $.extend( args, { action : smart_cf_relation_taxonomies.action, nonce : smart_cf_relation_taxonomies.nonce, click_count: click_count, taxonomies : taxonomies } ); $.post( smart_cf_relation_taxonomies.endpoint, args, function( response ) { btn_load.addClass( 'hide' ); $( response ).each( function( i, e ) { table.find( '.smart-cf-relation-children-select ul' ).append( $( '
  • ' ) .attr( 'data-id', this.term_id ) .text( this.name ) ); } ); btn_load.text( btn_load_text ); btn_load.removeClass( 'hide' ); } ); return false; } } ); css/settings.css000064400000014472146726725200007731 0ustar00/** * settings.css * Version : 1.1.0 * Author : inc2734 * Created : September 23, 2014 * Modified : July 14, 2018 * License : GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ /** ================================================== * #normal-sortables */ #normal-sortables { display: none; } /** ================================================== * .btn-add-group */ .smart-cf-fields-wrapper .btn-add-group { margin-top: 10px; } /** ================================================== * .smart-cf-group */ .smart-cf-group { background: #f5f5f5; border: #eee solid 1px; margin: 10px 0 0; padding: 10px; position: relative; } .smart-cf-group .smart-cf-require { color: #f60; font-size: 90%; margin-left: 3px; } .smart-cf-group .smart-cf-notes { color: #999; font-size: 90%; } /** * .btn-remove-group */ .smart-cf-group .btn-remove-group { cursor: pointer; position: absolute; top: 10px; right: 10px; } .smart-cf-group .btn-remove-group .dashicons, .smart-cf-group .btn-remove-group .dashicons:before { font-size: 14px; height: 14px; width: 14px; } /** * .btn-add-field */ .smart-cf-group .btn-add-field { margin-top: 5px; } /** * .smart-cf-group-repeat */ .smart-cf-group .smart-cf-group-repeat { margin: 0 0 5px; } .smart-cf-group .smart-cf-group-repeat label { position: relative; top: -2px; } @media (max-width:750px) { .smart-cf-group .smart-cf-group-name { max-width:79%; } } /** * .smart-cf-group-names */ .smart-cf-group .smart-cf-group-names { width: 100%; } .smart-cf-group .smart-cf-group-names th { text-align: left; width: 20%; } /** * .smart-cf-alert */ .smart-cf-alert { color: #f60; display: block; font-size: 90%; margin-top: 2px 0; } /** ================================================== * .smart-cf-fields */ .smart-cf-group .smart-cf-fields { margin-top: 7px; } /** ================================================== * .smart-cf-field */ .smart-cf-group .smart-cf-field { background: #fff; border: #eee solid 1px; margin: 5px 0 0; padding: 10px; overflow: hidden; *zoom: 1; } .smart-cf-group .smart-cf-field:first-child { margin-top: 0; } .smart-cf-group .smart-cf-field table { border-collapse: collapse; width: 100%; } .smart-cf-group .smart-cf-field table th, .smart-cf-group .smart-cf-field table td { padding: 5px 0; } .smart-cf-group .smart-cf-field table th { font-weight: normal; padding-top: 10px; padding-right: 15px; text-align: left; vertical-align: top; width: 15%; } .smart-cf-group .smart-cf-field table table { margin: -5px 0; } /** * .smart-cf-icon-handle */ .smart-cf-group .smart-cf-field .smart-cf-icon-handle { float: left; margin-top: 4px; margin-right: 8px; } /** * .field-label */ .smart-cf-group .smart-cf-field .field-label { cursor: pointer; position: relative; overflow: hidden; *zoom: 1; } .smart-cf-group .smart-cf-field .field-label small { color: #999; font-size: 90%; } /** * .btn-remove-field */ .smart-cf-group .smart-cf-field .btn-remove-field { cursor: pointer; float: right; } .smart-cf-group .smart-cf-field .btn-remove-field .dashicons, .smart-cf-group .smart-cf-field .btn-remove-field .dashicons:before { font-size: 14px; height: 14px; width: 14px; } /** ================================================== * #smart-cf-meta-box-condition */ #smart-cf-meta-box-condition-post b, #smart-cf-meta-box-condition-profile b, #smart-cf-meta-box-condition-taxonomy b, #smart-cf-meta-box-condition-options-page b { display: block; margin: 0 0 5px; } #smart-cf-meta-box-condition-post label, #smart-cf-meta-box-condition-profile label, #smart-cf-meta-box-condition-taxonomy label, #smart-cf-meta-box-condition-options-page label { display: block; margin: 0 0 5px; } #smart-cf-meta-box-condition-post .selectivity-multiple-input { box-shadow: none; } #smart-cf-meta-box-condition-post .selectivity-multiple-selected-item { margin-right: 5px; } #smart-cf-meta-box-condition-post .selectivity-multiple-selected-item-remove { font-weight: bold; color: #fff; } #smart-cf-meta-box-condition-post .selectivity-multiple-input-container { border: 1px solid #ddd; box-shadow: inset 0 1px 2px rgba(0,0,0,.07); background-color: #fff; color: #32373c; outline: 0; transition: 50ms border-color ease-in-out; border-radius: 0; } #smart-cf-meta-box-condition-post .selectivity-dropdown, #smart-cf-meta-box-condition-post .selectivity-result-item:first-child, #smart-cf-meta-box-condition-post .selectivity-load-more, #smart-cf-meta-box-condition-post .selectivity-result-item:last-child, #smart-cf-meta-box-condition-post .selectivity-result-children:last-child .selectivity-result-item:last-child { border-radius: 0; } .smart-cf-group .smart-cf-group-repeat label .ios-ui-select, #smart-cf-meta-box-condition-post .ios-ui-select, #smart-cf-meta-box-condition-profile .ios-ui-select, #smart-cf-meta-box-condition-taxonomy .ios-ui-select, #smart-cf-meta-box-condition-options-page .ios-ui-select { height: 18px; width: 32px; margin-bottom: -5px; position: relative; background: #ddd; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07); } .smart-cf-group .smart-cf-group-repeat label .ios-ui-select .inner, #smart-cf-meta-box-condition-post .ios-ui-select .inner, #smart-cf-meta-box-condition-profile .ios-ui-select .inner, #smart-cf-meta-box-condition-taxonomy .ios-ui-select .inner, #smart-cf-meta-box-condition-options-page .ios-ui-select .inner { width: 12px; height: 12px; } .smart-cf-group .smart-cf-group-repeat label .ios-ui-select.checked .inner, #smart-cf-meta-box-condition-post .ios-ui-select.checked .inner, #smart-cf-meta-box-condition-profile .ios-ui-select.checked .inner, #smart-cf-meta-box-condition-taxonomy .ios-ui-select.checked .inner, #smart-cf-meta-box-condition-options-page .ios-ui-select.checked .inner { left: 17px; } /** ================================================== * .hide */ .smart-cf-group .smart-cf-field table tr.hide, .smart-cf-group.hide, .smart-cf-group .btn-add-field.hide, .smart-cf-group .smart-cf-group-names.hide, .smart-cf-group .smart-cf-field.hide, .smart-cf-group .smart-cf-field table.hide { display: none; } /** ================================================== * classes */ .smart-cf-icon-handle { background: url( ../images/handle.png ) no-repeat; cursor: move; display: inline-block; margin-right: 10px; height: 10px; width: 10px; overflow: hidden; position: relative; } css/wysiwyg.css000064400000000440146726725200007601 0ustar00/** * wysiwyg.css * Version : 1.0.0 * Author : inc2734 * Created : April 11, 2015 * Modified : * License : GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ body { font-family: "Open Sans", Helvetica, Arial, sans-serif; font-size: 13px; }css/editor.css000064400000013434146726725200007354 0ustar00/** * editor.css * Version : 1.3.1 * Author : inc2734 * Created : September 23, 2014 * Modified : June 4, 2016 * License : GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ /** ================================================== * #normal-sortables */ .smart-cf-meta-box { margin: 0 -12px; } /** ================================================== * .smart-cf-meta-box-table */ .smart-cf-meta-box-table { background: #fff; border-bottom: #eee solid 1px; padding: 10px 12px; } .smart-cf-meta-box-table table { width: 100%; } .smart-cf-meta-box-table th, .smart-cf-meta-box-table td { font-weight: normal; text-align: left; padding: 7px 5px; vertical-align: top; } .smart-cf-meta-box-table th { width: 25%; } .smart-cf-meta-box-table td label { margin-right: 10px; } .smart-cf-meta-box-table .wp-editor-tools:after { display: block; } .smart-cf-meta-box-table .wp-editor-container { clear: both; } .smart-cf-meta-box-table td .instruction { font-size: 14px; margin: 0 0 10px; } .smart-cf-meta-box-table td .description { font-size: 12px; margin: 10px 0 0; color: #888; } .smart-cf-meta-box-table td .clear { clear: both; } /** ================================================== * .smart-cf-meta-box-repeat-tables */ .smart-cf-meta-box-repeat-tables .smart-cf-meta-box-table > .smart-cf-icon-handle, .smart-cf-meta-box-repeat-tables .smart-cf-meta-box-table > .smart-cf-repeat-btn { position: relative; top: 3px; vertical-align: middle; } .smart-cf-meta-box-repeat-tables .smart-cf-repeat-btn { cursor: pointer; width: auto; height: auto; font-size: 1.3em; padding: 0; -webkit-border-radius: 50%; border-radius: 50%; display: inline-block; vertical-align: middle; text-align: center; color: #999; margin-right: 3px; } .smart-cf-meta-box-repeat-tables .smart-cf-icon-handle:hover, .smart-cf-meta-box-repeat-tables .smart-cf-repeat-btn:hover { color: #333; } .smart-cf-meta-box-repeat-tables table { margin-top: 7px; } /** ================================================== * relation */ .smart-cf-meta-box-table .smart-cf-relation-left, .smart-cf-meta-box-table .smart-cf-relation-right { border: #ddd solid 1px; border-radius: 3px; height: 160px; } .smart-cf-meta-box-table .smart-cf-relation-left ul, .smart-cf-meta-box-table .smart-cf-relation-right ul { list-style: none; margin: 0; padding: 0; } .smart-cf-meta-box-table .smart-cf-relation-left ul li, .smart-cf-meta-box-table .smart-cf-relation-right ul li { background: #fff; border-bottom: #eee solid 1px; color: #999; margin: 0; padding: 5px 10px; position: relative; } .smart-cf-meta-box-table .smart-cf-relation-left ul li[data-status="publish"], .smart-cf-meta-box-table .smart-cf-relation-right ul li[data-status="publish"] { color: #0074a2; } .smart-cf-meta-box-table .smart-cf-relation-left ul li::after, .smart-cf-meta-box-table .smart-cf-relation-right ul li::after { content: attr(data-status); display: inline-block; background-color: #999; color: #fff; border-radius: 4px; padding: 0 3px; font-size: 10px; margin-left: .5em; position: relative; top: -1px; } .smart-cf-meta-box-table .smart-cf-relation-left ul li[data-status="publish"]::after, .smart-cf-meta-box-table .smart-cf-relation-right ul li[data-status="publish"]::after { display: none; } .smart-cf-meta-box-table .smart-cf-relation-left { float: left; width: 47%; overflow: hidden; } .smart-cf-meta-box-table .smart-cf-relation-left .smart-cf-search { background-color: #f5f5f5; border-bottom: 1px solid #eee; padding: 5px; } .smart-cf-meta-box-table .smart-cf-relation-left .smart-cf-relation-children-select { overflow: auto; height: 122px; } .smart-cf-meta-box-table .smart-cf-relation-left ul li { cursor: pointer; } .smart-cf-meta-box-table .smart-cf-relation-left ul li:hover { background: #e4f6fd; } .smart-cf-meta-box-table .smart-cf-relation-left .load-relation-items { background: #e4f6fd; cursor: pointer; margin: 0; padding: 6px 10px; text-align: center; } .smart-cf-meta-box-table .smart-cf-relation-left .load-relation-items:hover { background: #c1ebfc; } .smart-cf-meta-box-table .smart-cf-relation-right { float: right; width: 50%; overflow: auto; } .smart-cf-meta-box-table .smart-cf-relation-right ul li { padding-right: 30px; padding-left: 30px; } .smart-cf-meta-box-table .smart-cf-relation-right ul li .smart-cf-icon-handle { position: absolute; top: 4px; left: 5px; margin: 0; } .smart-cf-meta-box-table .smart-cf-relation-right ul li .relation-remove { cursor: pointer; display: block; display: flex; align-items: center; justify-content: center; height: 12px; width: 12px; line-height: 1; border-radius: 3px; position: absolute; top: 7px; right: 6px; color: #fff; background-color: #32373c; } /** ================================================== * .smart-cf-upload-image, .smart-cf-upload-file */ .smart-cf-upload-image, .smart-cf-upload-file { display: inline-block; position: relative; } .smart-cf-upload-image img, .smart-cf-upload-file img { margin-top: 5px; max-width: 100%; vertical-align: top; } .smart-cf-upload-image .btn-remove-image, .smart-cf-upload-file .btn-remove-file { background: red; border-radius: 3px; color: #fff; cursor: pointer; display: block; font-size: 10px; padding: 2px 6px; position: absolute; left: 5px; bottom: 5px; } /** ================================================== * .hide */ .smart-cf-upload-image.hide, .smart-cf-upload-file.hide, .smart-cf-upload-image .btn-remove-image.hide, .smart-cf-upload-file .btn-remove-file.hide, .load-relation-items.hide { display: none; } /** ================================================== * classes */ .smart-cf-icon-handle { cursor: move; display: inline-block; margin-right: 10px; overflow: hidden; position: relative; color: #CCC; } .smart-cf-item-vertical { display: block; margin: 0 0 3px; } css/profile.css000064400000001040146726725200007514 0ustar00/** * profile.css * Version : 1.0.0 * Author : inc2734 * Created : March 18, 2014 * Modified : * License : GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ /** ================================================== * .smart-cf-meta-box */ .smart-cf-meta-box:first-child { border-top: #ddd solid 1px; } /** ================================================== * .smart-cf-meta-box-table */ .smart-cf-meta-box-table { background: transparent; border-bottom: #ddd solid 1px; padding: 10px 0; } css/option.css000064400000000311146726725200007364 0ustar00/** * option.css * Version : 1.0.0 * Author : inc2734 * Created : May 30, 2016 * Modified : * License : GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ css/taxonomy.css000064400000000571146726725200007742 0ustar00/** * taxonomy.css * Version : 1.0.0 * Author : inc2734 * Created : April 26, 2014 * Modified : * License : GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html */ /** ================================================== * .smart-cf-meta-box-table */ .smart-cf-meta-box-table { background: transparent; border-bottom-color: #ddd; } composer.lock000064400000255171146726725200007273 0ustar00{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "a33ab1047730fe744941add9e8020420", "packages": [], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Franck Nijhof", "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" }, { "name": "Contributors", "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", "code quality", "codesniffer", "composer", "installer", "phpcbf", "phpcs", "plugin", "qa", "quality", "standard", "standards", "style guide", "stylecheck", "tests" ], "support": { "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, "time": "2022-02-04T12:51:07+00:00" }, { "name": "doctrine/instantiator", "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", "type": "custom" }, { "url": "https://www.patreon.com/phpdoctrine", "type": "patreon" }, { "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", "type": "tidelift" } ], "time": "2022-12-30T00:15:36+00:00" }, { "name": "myclabs/deep-copy", "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "conflict": { "doctrine/collections": "<1.6.8", "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { "files": [ "src/DeepCopy/deep_copy.php" ], "psr-4": { "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", "keywords": [ "clone", "copy", "duplicate", "object", "object graph" ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", "type": "tidelift" } ], "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { "ext-ctype": "*", "ext-json": "*", "ext-tokenizer": "*", "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" ], "type": "library", "extra": { "branch-alias": { "dev-master": "5.0-dev" } }, "autoload": { "psr-4": { "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Nikita Popov" } ], "description": "A PHP parser written in PHP", "keywords": [ "parser", "php" ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, "time": "2024-03-05T20:51:40+00:00" }, { "name": "phar-io/manifest", "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Arne Blankerts", "email": "arne@blankerts.de", "role": "Developer" }, { "name": "Sebastian Heuer", "email": "sebastian@phpeople.de", "role": "Developer" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "Developer" } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, "funding": [ { "url": "https://github.com/theseer", "type": "github" } ], "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Arne Blankerts", "email": "arne@blankerts.de", "role": "Developer" }, { "name": "Sebastian Heuer", "email": "sebastian@phpeople.de", "role": "Developer" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "Developer" } ], "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", "source": "https://github.com/phar-io/version/tree/3.2.1" }, "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { "php": ">=5.3", "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, "conflict": { "squizlabs/php_codesniffer": "2.6.2" }, "require-dev": { "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "homepage": "https://github.com/wimg", "role": "lead" }, { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "lead" }, { "name": "Contributors", "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ "compatibility", "phpcs", "standards" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, "time": "2019-12-27T09:44:58+00:00" }, { "name": "phpcompatibility/phpcompatibility-paragonie", "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "role": "lead" }, { "name": "Juliette Reinders Folmer", "role": "lead" } ], "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", "homepage": "http://phpcompatibility.com/", "keywords": [ "compatibility", "paragonie", "phpcs", "polyfill", "standards", "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, "time": "2022-10-25T01:46:02+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0", "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "role": "lead" }, { "name": "Juliette Reinders Folmer", "role": "lead" } ], "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", "homepage": "http://phpcompatibility.com/", "keywords": [ "compatibility", "phpcs", "standards", "static analysis", "wordpress" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, "time": "2022-10-24T09:00:36+00:00" }, { "name": "phpcsstandards/phpcsextra", "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", "shasum": "" }, "require": { "php": ">=5.4", "phpcsstandards/phpcsutils": "^1.0.9", "squizlabs/php_codesniffer": "^3.8.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", "phpcsstandards/phpcsdevtools": "^1.2.1", "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { "dev-stable": "1.x-dev", "dev-develop": "1.x-dev" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "lead" }, { "name": "Contributors", "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" } ], "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", "keywords": [ "PHP_CodeSniffer", "phpcbf", "phpcodesniffer-standard", "phpcs", "standards", "static analysis" ], "support": { "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, "funding": [ { "url": "https://github.com/PHPCSStandards", "type": "github" }, { "url": "https://github.com/jrfnl", "type": "github" }, { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" } ], "time": "2023-12-08T16:49:07+00:00" }, { "name": "phpcsstandards/phpcsutils", "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", "reference": "908247bc65010c7b7541a9551e002db12e9dae70" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", "reference": "908247bc65010c7b7541a9551e002db12e9dae70", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { "dev-stable": "1.x-dev", "dev-develop": "1.x-dev" } }, "autoload": { "classmap": [ "PHPCSUtils/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "lead" }, { "name": "Contributors", "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" } ], "description": "A suite of utility functions for use with PHP_CodeSniffer", "homepage": "https://phpcsutils.com/", "keywords": [ "PHP_CodeSniffer", "phpcbf", "phpcodesniffer-standard", "phpcs", "phpcs3", "standards", "static analysis", "tokens", "utility" ], "support": { "docs": "https://phpcsutils.com/", "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSUtils" }, "funding": [ { "url": "https://github.com/PHPCSStandards", "type": "github" }, { "url": "https://github.com/jrfnl", "type": "github" }, { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" } ], "time": "2023-12-08T14:50:00+00:00" }, { "name": "phpunit/php-code-coverage", "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", "sebastian/code-unit-reverse-lookup": "^2.0.2", "sebastian/complexity": "^2.0", "sebastian/environment": "^5.1.2", "sebastian/lines-of-code": "^1.0.3", "sebastian/version": "^3.0.1", "theseer/tokenizer": "^1.2.0" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { "dev-master": "9.2-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ "coverage", "testing", "xunit" ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ "filesystem", "iterator" ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2021-12-02T12:48:52+00:00" }, { "name": "phpunit/php-invoker", "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "ext-pcntl": "*", "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.1-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Invoke callables with a timeout", "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ "process" ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-09-28T05:58:55+00:00" }, { "name": "phpunit/php-text-template", "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Simple template engine.", "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ "template" ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-10-26T05:33:50+00:00" }, { "name": "phpunit/php-timer", "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "5.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Utility class for timing", "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ "timer" ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", "version": "9.6.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", "shasum": "" }, "require": { "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", "phpunit/php-code-coverage": "^9.2.28", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files", "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" ], "type": "library", "extra": { "branch-alias": { "dev-master": "9.6-dev" } }, "autoload": { "files": [ "src/Framework/Assert/Functions.php" ], "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "The PHP Unit Testing framework.", "homepage": "https://phpunit.de/", "keywords": [ "phpunit", "testing", "xunit" ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" }, "funding": [ { "url": "https://phpunit.de/sponsors.html", "type": "custom" }, { "url": "https://github.com/sebastianbergmann", "type": "github" }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], "time": "2024-02-23T13:14:51+00:00" }, { "name": "sebastian/cli-parser", "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library for parsing CLI options", "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { "php": ">=7.3", "sebastian/diff": "^4.0", "sebastian/exporter": "^4.0" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, { "name": "Volker Dusch", "email": "github@wallbash.com" }, { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" } ], "description": "Provides the functionality to compare PHP values for equality", "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library for calculating the complexity of PHP code units", "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff", "udiff", "unidiff", "unified diff" ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { "dev-master": "5.1-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Provides functionality to handle HHVM/PHP environments", "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", "hhvm" ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { "php": ">=7.3", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, { "name": "Volker Dusch", "email": "github@wallbash.com" }, { "name": "Adam Harvey", "email": "aharvey@php.net" }, { "name": "Bernhard Schussek", "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-dom": "*", "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { "dev-master": "5.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Snapshotting of global state", "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library for counting the lines of code in PHP source code", "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], "description": "Provides functionality to recursively process PHP variables", "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.2-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ "bin/phpcbf", "bin/phpcs" ], "type": "library", "extra": { "branch-alias": { "dev-master": "3.x-dev" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Greg Sherwood", "role": "Former lead" }, { "name": "Juliette Reinders Folmer", "role": "Current lead" }, { "name": "Contributors", "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, "funding": [ { "url": "https://github.com/PHPCSStandards", "type": "github" }, { "url": "https://github.com/jrfnl", "type": "github" }, { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" } ], "time": "2024-02-16T15:06:51+00:00" }, { "name": "theseer/tokenizer", "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Arne Blankerts", "email": "arne@blankerts.de", "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { "url": "https://github.com/theseer", "type": "github" } ], "time": "2024-03-03T12:36:25+00:00" }, { "name": "wp-coding-standards/wpcs", "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", "shasum": "" }, "require": { "ext-filter": "*", "ext-libxml": "*", "ext-tokenizer": "*", "ext-xmlreader": "*", "php": ">=5.4", "phpcsstandards/phpcsextra": "^1.1.0", "phpcsstandards/phpcsutils": "^1.0.8", "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.2.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-iconv": "For improved results", "ext-mbstring": "For improved results" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Contributors", "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", "keywords": [ "phpcs", "standards", "static analysis", "wordpress" ], "support": { "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, "funding": [ { "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", "type": "custom" } ], "time": "2023-09-14T07:06:09+00:00" }, { "name": "yoast/phpunit-polyfills", "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", "shasum": "" }, "require": { "php": ">=5.4", "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { "yoast/yoastcs": "^2.3.0" }, "type": "library", "extra": { "branch-alias": { "dev-main": "2.x-dev" } }, "autoload": { "files": [ "phpunitpolyfills-autoload.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Team Yoast", "email": "support@yoast.com", "homepage": "https://yoast.com" }, { "name": "Contributors", "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" } ], "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", "keywords": [ "phpunit", "polyfill", "testing" ], "support": { "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, "time": "2023-08-19T14:25:08+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.4" }, "platform-dev": [], "plugin-api-version": "2.6.0" } languages/smart-custom-fields-ja.po000064400000024546146726725200013372 0ustar00# Copyright (C) 2015 Smart Custom Fields # This file is distributed under the same license as the Smart Custom Fields package. msgid "" msgstr "" "Project-Id-Version: Smart Custom Fields 3.1.7\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-custom-" "fields\n" "POT-Creation-Date: 2018-06-26 09:22+0900\n" "PO-Revision-Date: 2018-06-26 09:22+0900\n" "Last-Translator: inc2734 \n" "Language-Team: Japanese\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Poedit 2.0.4\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Poedit-KeywordsList: __;_e;esc_html__;esc_html_e;esc_attr__;esc_attr_e\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SearchPath-0: .\n" #: classes/controller/class.controller-base.php:46 msgid "Image setting" msgstr "画像設定" #: classes/controller/class.controller-base.php:47 msgid "File setting" msgstr "ファイル設定" #: classes/controller/class.option.php:57 msgid "Save settings" msgstr "設定を保存" #: classes/controller/class.profile.php:43 #: classes/controller/class.settings.php:82 msgid "Custom Fields" msgstr "カスタムフィールド" #: classes/controller/class.settings.php:29 msgid "Basic fields" msgstr "基本フィールド" #: classes/controller/class.settings.php:33 msgid "Select fields" msgstr "選択フィールド" #: classes/controller/class.settings.php:37 msgid "Content fields" msgstr "コンテンツフィールド" #: classes/controller/class.settings.php:41 msgid "Other fields" msgstr "その他のフィールド" #: classes/controller/class.settings.php:69 msgid "Same name exists!" msgstr "同じ名前が存在します!" #: classes/controller/class.settings.php:88 msgid "Display conditions ( Post )" msgstr "表示条件(投稿)" #: classes/controller/class.settings.php:95 msgid "Display conditions ( Profile )" msgstr "表示条件(プロフィール)" #: classes/controller/class.settings.php:102 msgid "Display conditions ( Taxonomy )" msgstr "表示条件(タクソノミー)" #: classes/controller/class.settings.php:109 msgid "Display conditions ( Options page )" msgstr "表示条件(オプションページ)" #: classes/controller/class.settings.php:169 msgid "Type" msgstr "タイプ" #: classes/controller/class.settings.php:204 msgid "Add Sub field" msgstr "サブフィールドを追加" #: classes/controller/class.settings.php:208 msgid "Add Field" msgstr "フィールド追加" #: classes/controller/class.settings.php:238 #: classes/fields/class.field-related-posts.php:235 msgid "Post Types" msgstr "投稿タイプ" #: classes/controller/class.settings.php:245 msgid "Post Ids ( Comma separated )" msgstr "投稿 ID (カンマ区切り)" #: classes/controller/class.settings.php:270 msgid "Roles" msgstr "権限" #: classes/controller/class.settings.php:296 #: classes/fields/class.field-related-terms.php:233 msgid "Taxonomies" msgstr "タクソノミー" #: classes/controller/class.settings.php:320 msgid "Options pages" msgstr "オプションページ" #: classes/fields/class.field-boolean.php:23 msgid "Boolean" msgstr "真偽値" #: classes/fields/class.field-boolean.php:38 msgid "Yes" msgstr "はい" #: classes/fields/class.field-boolean.php:39 msgid "No" msgstr "いいえ" #: classes/fields/class.field-boolean.php:85 #: classes/fields/class.field-check.php:119 #: classes/fields/class.field-colorpicker.php:107 #: classes/fields/class.field-datepicker.php:130 #: classes/fields/class.field-radio.php:118 #: classes/fields/class.field-select.php:93 #: classes/fields/class.field-text.php:68 #: classes/fields/class.field-textarea.php:81 #: classes/fields/class.field-wysiwyg.php:124 msgid "Default" msgstr "デフォルト" #: classes/fields/class.field-boolean.php:110 msgid "TRUE Label" msgstr "TRUE ラベル" #: classes/fields/class.field-boolean.php:120 msgid "FALSE Label" msgstr "FALSE ラベル" #: classes/fields/class.field-boolean.php:130 #: classes/fields/class.field-check.php:128 #: classes/fields/class.field-colorpicker.php:116 #: classes/fields/class.field-datepicker.php:194 #: classes/fields/class.field-file.php:119 #: classes/fields/class.field-image.php:114 #: classes/fields/class.field-radio.php:127 #: classes/fields/class.field-related-posts.php:264 #: classes/fields/class.field-related-terms.php:260 #: classes/fields/class.field-select.php:102 #: classes/fields/class.field-text.php:77 #: classes/fields/class.field-textarea.php:90 #: classes/fields/class.field-wysiwyg.php:133 msgid "Instruction" msgstr "説明文" #: classes/fields/class.field-boolean.php:137 #: classes/fields/class.field-check.php:135 #: classes/fields/class.field-colorpicker.php:123 #: classes/fields/class.field-datepicker.php:201 #: classes/fields/class.field-file.php:126 #: classes/fields/class.field-image.php:121 #: classes/fields/class.field-message.php:77 #: classes/fields/class.field-radio.php:134 #: classes/fields/class.field-related-posts.php:271 #: classes/fields/class.field-related-terms.php:267 #: classes/fields/class.field-select.php:109 #: classes/fields/class.field-text.php:84 #: classes/fields/class.field-textarea.php:97 #: classes/fields/class.field-wysiwyg.php:140 msgid "Notes" msgstr "注記" #: classes/fields/class.field-check.php:21 msgid "Check" msgstr "チェックボックス" #: classes/fields/class.field-check.php:89 #: classes/fields/class.field-radio.php:88 #: classes/fields/class.field-select.php:83 msgid "Choices" msgstr "選択肢" #: classes/fields/class.field-check.php:95 #: classes/fields/class.field-radio.php:94 #: classes/fields/class.field-select.php:89 msgid "" "If you want to separate the key and the value, enter as follows: key => value" msgstr "もしキーと値を分けたい場合は次のように入力してください: キー => 値" #: classes/fields/class.field-check.php:99 #: classes/fields/class.field-radio.php:98 msgid "Display Direction" msgstr "表示方向" #: classes/fields/class.field-check.php:103 #: classes/fields/class.field-radio.php:102 msgid "horizontal" msgstr "水平方向" #: classes/fields/class.field-check.php:104 #: classes/fields/class.field-radio.php:103 msgid "vertical" msgstr "垂直方向" #: classes/fields/class.field-colorpicker.php:29 msgid "Color picker" msgstr "カラーピッカー" #: classes/fields/class.field-datepicker.php:29 msgid "Date picker" msgstr "日付ピッカー" #: classes/fields/class.field-datepicker.php:140 msgid "Date Format" msgstr "日付のフォーマット" #: classes/fields/class.field-datepicker.php:148 msgid "e.g dd/mm/yy" msgstr "例: dd/mm/yy" #: classes/fields/class.field-datepicker.php:158 msgid "Max Date" msgstr "最大日付" #: classes/fields/class.field-datepicker.php:166 #: classes/fields/class.field-datepicker.php:184 msgid "e.g +1m +1w" msgstr "例: +1m +1w" #: classes/fields/class.field-datepicker.php:176 msgid "Min Date" msgstr "最小日付" #: classes/fields/class.field-file.php:21 msgid "File" msgstr "ファイル" #: classes/fields/class.field-file.php:51 #: classes/fields/class.field-image.php:52 msgid "Delete" msgstr "削除" #: classes/fields/class.field-file.php:98 msgid "File Select" msgstr "ファイル選択" #: classes/fields/class.field-image.php:21 msgid "Image" msgstr "画像" #: classes/fields/class.field-image.php:92 msgid "Image Select" msgstr "画像選択" #: classes/fields/class.field-image.php:131 msgid "Preview Size" msgstr "プレビューサイズ" #: classes/fields/class.field-message.php:21 #: classes/fields/class.field-message.php:68 msgid "Message" msgstr "メッセージ" #: classes/fields/class.field-radio.php:21 msgid "Radio" msgstr "ラジオボタン" #: classes/fields/class.field-related-posts.php:24 msgid "Related Posts" msgstr "関連する投稿" #: classes/fields/class.field-related-posts.php:211 #: classes/fields/class.field-related-terms.php:209 msgid "Search..." msgstr "検索 …" #: classes/fields/class.field-related-posts.php:215 #: classes/fields/class.field-related-terms.php:213 msgid "Load more" msgstr "さらに読み込む" #: classes/fields/class.field-related-posts.php:256 #: classes/fields/class.field-related-terms.php:252 msgid "Selectable number" msgstr "選択できる個数" #: classes/fields/class.field-related-terms.php:24 msgid "Related Terms" msgstr "関連するターム" #: classes/fields/class.field-select.php:21 msgid "Select" msgstr "セレクトボックス" #: classes/fields/class.field-text.php:21 #: classes/fields/class.field-wysiwyg.php:108 msgid "Text" msgstr "テキスト" #: classes/fields/class.field-textarea.php:21 msgid "Textarea" msgstr "テキストエリア" #: classes/fields/class.field-textarea.php:71 msgid "Rows" msgstr "行数" #: classes/fields/class.field-wysiwyg.php:26 msgid "Wysiwyg" msgstr "WYSIWYG" #: classes/fields/class.field-wysiwyg.php:107 msgid "Visual" msgstr "ビジュアル" #: classes/fields/class.field-wysiwyg.php:162 #: classes/fields/class.field-wysiwyg.php:163 msgid "Add Media" msgstr "メディアを追加" #: classes/models/class.abstract-field-base.php:118 msgid "Name" msgstr "名前" #: classes/models/class.abstract-field-base.php:134 msgid "Label" msgstr "ラベル" #: classes/models/class.group.php:127 msgid "Repeat" msgstr "繰り返し" #: classes/models/class.group.php:132 msgid "Group name" msgstr "グループ名" #: classes/models/class.revisions.php:128 smart-custom-fields.php:168 #: smart-custom-fields.php:169 smart-custom-fields.php:170 msgid "Smart Custom Fields" msgstr "Smart Custom Fields" #: smart-custom-fields.php:171 smart-custom-fields.php:172 #: smart-custom-fields.php:218 smart-custom-fields.php:219 msgid "Add New" msgstr "新規追加" #: smart-custom-fields.php:173 msgid "New Field" msgstr "新規フィールド" #: smart-custom-fields.php:174 msgid "Edit Field" msgstr "フィールド編集" #: smart-custom-fields.php:175 msgid "View Field" msgstr "フィールドを表示" #: smart-custom-fields.php:176 msgid "All Fields" msgstr "すべてのフィールド" #: smart-custom-fields.php:177 msgid "Search Fields" msgstr "フィールドを検索" #: smart-custom-fields.php:178 msgid "Parent Fields:" msgstr "親フィールド:" #: smart-custom-fields.php:179 msgid "No Fields found." msgstr "フィールドは見つかりませんでした。" #: smart-custom-fields.php:180 msgid "No Fields found in Trash." msgstr "ゴミ箱にフィールドは見つかりませんでした。" languages/smart-custom-fields.pot000064400000011456146726725200013162 0ustar00# Copyright (C) 2018 Smart Custom Fields # This file is distributed under the same license as the Smart Custom Fields package. #, fuzzy msgid "" msgstr "" "Project-Id-Version: Smart Custom Fields 3.1.7\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-custom-" "fields\n" "POT-Creation-Date: 2018-07-14 22:36-0300\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Smart Custom Fields \n" "X-Generator: Poedit 2.0.9\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: esc_html__;__;_n;_x;_n_noop;_e\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SearchPath-0: .\n" #: classes/controller/class.controller-base.php:46 msgid "Image setting" msgstr "" #: classes/controller/class.controller-base.php:47 msgid "File setting" msgstr "" #: classes/controller/class.profile.php:43 #: classes/controller/class.settings.php:162 msgid "Custom Fields" msgstr "" #: classes/controller/class.settings.php:145 msgid "Same name exists!" msgstr "" #: classes/controller/class.settings.php:146 msgid "Type to search a post or page" msgstr "" #: classes/controller/class.settings.php:147 msgid "Loading..." msgstr "" #: classes/controller/class.settings.php:148 #: classes/fields/class.field-related-posts.php:215 #: classes/fields/class.field-related-terms.php:213 msgid "Load more" msgstr "" #: classes/controller/class.settings.php:168 msgid "Display conditions ( Post )" msgstr "" #: classes/controller/class.settings.php:175 msgid "Display conditions ( Profile )" msgstr "" #: classes/controller/class.settings.php:182 msgid "Display conditions ( Taxonomy )" msgstr "" #: classes/controller/class.settings.php:189 msgid "Display conditions ( Options page )" msgstr "" #: classes/controller/class.settings.php:318 msgid "Post Types" msgstr "" #: classes/controller/class.settings.php:367 msgid "Post or Page Ids" msgstr "" #: classes/controller/class.settings.php:398 msgid "Roles" msgstr "" #: classes/controller/class.settings.php:424 msgid "Taxonomies" msgstr "" #: classes/controller/class.settings.php:448 msgid "Options pages" msgstr "" #: classes/fields/class.field-boolean.php:23 msgid "Boolean" msgstr "" #: classes/fields/class.field-boolean.php:38 msgid "Yes" msgstr "" #: classes/fields/class.field-boolean.php:39 msgid "No" msgstr "" #: classes/fields/class.field-check.php:21 msgid "Check" msgstr "" #: classes/fields/class.field-check.php:103 #: classes/fields/class.field-radio.php:102 msgid "horizontal" msgstr "" #: classes/fields/class.field-check.php:104 #: classes/fields/class.field-radio.php:103 msgid "vertical" msgstr "" #: classes/fields/class.field-colorpicker.php:29 msgid "Color picker" msgstr "" #: classes/fields/class.field-datepicker.php:29 msgid "Date picker" msgstr "" #: classes/fields/class.field-file.php:21 msgid "File" msgstr "" #: classes/fields/class.field-file.php:51 #: classes/fields/class.field-image.php:52 msgid "Delete" msgstr "" #: classes/fields/class.field-file.php:100 msgid "File Select" msgstr "" #: classes/fields/class.field-image.php:21 msgid "Image" msgstr "" #: classes/fields/class.field-image.php:94 msgid "Image Select" msgstr "" #: classes/fields/class.field-message.php:21 msgid "Message" msgstr "" #: classes/fields/class.field-radio.php:21 msgid "Radio" msgstr "" #: classes/fields/class.field-related-posts.php:24 msgid "Related Posts" msgstr "" #: classes/fields/class.field-related-terms.php:24 msgid "Related Terms" msgstr "" #: classes/fields/class.field-select.php:21 msgid "Select" msgstr "" #: classes/fields/class.field-text.php:21 #: classes/fields/class.field-wysiwyg.php:108 msgid "Text" msgstr "" #: classes/fields/class.field-textarea.php:21 msgid "Textarea" msgstr "" #: classes/fields/class.field-wysiwyg.php:26 msgid "Wysiwyg" msgstr "" #: classes/fields/class.field-wysiwyg.php:107 msgid "Visual" msgstr "" #: classes/fields/class.field-wysiwyg.php:163 msgid "Add Media" msgstr "" #: classes/models/class.revisions.php:128 smart-custom-fields.php:174 #: smart-custom-fields.php:175 smart-custom-fields.php:176 msgid "Smart Custom Fields" msgstr "" #: smart-custom-fields.php:177 smart-custom-fields.php:178 #: smart-custom-fields.php:224 smart-custom-fields.php:225 msgid "Add New" msgstr "" #: smart-custom-fields.php:179 msgid "New Field" msgstr "" #: smart-custom-fields.php:180 msgid "Edit Field" msgstr "" #: smart-custom-fields.php:181 msgid "View Field" msgstr "" #: smart-custom-fields.php:182 msgid "All Fields" msgstr "" #: smart-custom-fields.php:183 msgid "Search Fields" msgstr "" #: smart-custom-fields.php:184 msgid "Parent Fields:" msgstr "" #: smart-custom-fields.php:185 msgid "No Fields found." msgstr "" #: smart-custom-fields.php:186 msgid "No Fields found in Trash." msgstr "" languages/smart-custom-fields-pt_BR.po000064400000025223146726725200013777 0ustar00# Copyright (C) 2017 Smart Custom Fields # This file is distributed under the same license as the Smart Custom Fields package. msgid "" msgstr "" "Project-Id-Version: Smart Custom Fields 3.1.7\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-custom-" "fields\n" "POT-Creation-Date: 2018-07-14 22:36-0300\n" "PO-Revision-Date: 2018-07-14 22:37-0300\n" "Last-Translator: robssanches \n" "Language-Team: Português do Brasil\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Poedit 2.0.9\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Poedit-KeywordsList: __;_e;esc_html__;esc_html_e;esc_attr__;esc_attr_e\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SearchPath-0: .\n" #: classes/controller/class.controller-base.php:46 msgid "Image setting" msgstr "Configuração de imagem" #: classes/controller/class.controller-base.php:47 msgid "File setting" msgstr "Configuração de arquivo" #: classes/controller/class.option.php:57 msgid "Save settings" msgstr "Salvar configurações" #: classes/controller/class.profile.php:43 #: classes/controller/class.settings.php:162 msgid "Custom Fields" msgstr "Campos personalizados" #: classes/controller/class.settings.php:30 msgid "Basic fields" msgstr "Campos básicos" #: classes/controller/class.settings.php:34 msgid "Select fields" msgstr "Selecione os campos" #: classes/controller/class.settings.php:38 msgid "Content fields" msgstr "Campos de conteúdo" #: classes/controller/class.settings.php:42 msgid "Other fields" msgstr "Outros campos" #: classes/controller/class.settings.php:145 msgid "Same name exists!" msgstr "O mesmo nome existe!" #: classes/controller/class.settings.php:146 msgid "Type to search a post or page" msgstr "Digite para pesquisar um post ou página" #: classes/controller/class.settings.php:147 msgid "Loading..." msgstr "Carregando..." #: classes/controller/class.settings.php:148 #: classes/fields/class.field-related-posts.php:215 #: classes/fields/class.field-related-terms.php:213 msgid "Load more" msgstr "Carregar mais" #: classes/controller/class.settings.php:168 msgid "Display conditions ( Post )" msgstr "Condições de exibição (Post)" #: classes/controller/class.settings.php:175 msgid "Display conditions ( Profile )" msgstr "Condições de exibição (Perfil)" #: classes/controller/class.settings.php:182 msgid "Display conditions ( Taxonomy )" msgstr "Condições de exibição (Taxonomia)" #: classes/controller/class.settings.php:189 msgid "Display conditions ( Options page )" msgstr "Condições de exibição (Página de Opções)" #: classes/controller/class.settings.php:249 msgid "Type" msgstr "Tipo" #: classes/controller/class.settings.php:284 msgid "Add Sub field" msgstr "Adicionar Campo Secundário" #: classes/controller/class.settings.php:288 msgid "Add Field" msgstr "Adicionar Campo" #: classes/controller/class.settings.php:318 #: classes/fields/class.field-related-posts.php:235 msgid "Post Types" msgstr "Tipos de Post" #: classes/controller/class.settings.php:367 msgid "Post or Page Ids" msgstr "IDs de Posts ou Páginas" #: classes/controller/class.settings.php:398 msgid "Roles" msgstr "Funções" #: classes/controller/class.settings.php:424 #: classes/fields/class.field-related-terms.php:233 msgid "Taxonomies" msgstr "Taxonomias" #: classes/controller/class.settings.php:448 msgid "Options pages" msgstr "Páginas de opções" #: classes/fields/class.field-boolean.php:23 msgid "Boolean" msgstr "Verdadeiro ou Falso" #: classes/fields/class.field-boolean.php:38 msgid "Yes" msgstr "Sim" #: classes/fields/class.field-boolean.php:39 msgid "No" msgstr "Não" #: classes/fields/class.field-boolean.php:85 #: classes/fields/class.field-check.php:119 #: classes/fields/class.field-colorpicker.php:107 #: classes/fields/class.field-datepicker.php:130 #: classes/fields/class.field-radio.php:118 #: classes/fields/class.field-select.php:93 #: classes/fields/class.field-text.php:68 #: classes/fields/class.field-textarea.php:81 #: classes/fields/class.field-wysiwyg.php:124 msgid "Default" msgstr "Padrão" #: classes/fields/class.field-boolean.php:110 msgid "TRUE Label" msgstr "Rótulo VERDADEIRO" #: classes/fields/class.field-boolean.php:120 msgid "FALSE Label" msgstr "Rótulo FALSO" #: classes/fields/class.field-boolean.php:130 #: classes/fields/class.field-check.php:128 #: classes/fields/class.field-colorpicker.php:116 #: classes/fields/class.field-datepicker.php:194 #: classes/fields/class.field-file.php:121 #: classes/fields/class.field-image.php:116 #: classes/fields/class.field-radio.php:127 #: classes/fields/class.field-related-posts.php:264 #: classes/fields/class.field-related-terms.php:260 #: classes/fields/class.field-select.php:102 #: classes/fields/class.field-text.php:77 #: classes/fields/class.field-textarea.php:90 #: classes/fields/class.field-wysiwyg.php:133 msgid "Instruction" msgstr "Instrução" #: classes/fields/class.field-boolean.php:137 #: classes/fields/class.field-check.php:135 #: classes/fields/class.field-colorpicker.php:123 #: classes/fields/class.field-datepicker.php:201 #: classes/fields/class.field-file.php:128 #: classes/fields/class.field-image.php:123 #: classes/fields/class.field-message.php:77 #: classes/fields/class.field-radio.php:134 #: classes/fields/class.field-related-posts.php:271 #: classes/fields/class.field-related-terms.php:267 #: classes/fields/class.field-select.php:109 #: classes/fields/class.field-text.php:84 #: classes/fields/class.field-textarea.php:97 #: classes/fields/class.field-wysiwyg.php:140 msgid "Notes" msgstr "Notas" #: classes/fields/class.field-check.php:21 msgid "Check" msgstr "Checkbox" #: classes/fields/class.field-check.php:89 #: classes/fields/class.field-radio.php:88 #: classes/fields/class.field-select.php:83 msgid "Choices" msgstr "Opções" #: classes/fields/class.field-check.php:95 #: classes/fields/class.field-radio.php:94 #: classes/fields/class.field-select.php:89 msgid "" "If you want to separate the key and the value, enter as follows: key => value" msgstr "" "Se você deseja separar a chave e o valor, insira da seguinte forma: key => " "value" #: classes/fields/class.field-check.php:99 #: classes/fields/class.field-radio.php:98 msgid "Display Direction" msgstr "Direção de Exibição" #: classes/fields/class.field-check.php:103 #: classes/fields/class.field-radio.php:102 msgid "horizontal" msgstr "horizontal" #: classes/fields/class.field-check.php:104 #: classes/fields/class.field-radio.php:103 msgid "vertical" msgstr "vertical" #: classes/fields/class.field-colorpicker.php:29 msgid "Color picker" msgstr "Seletor de cores" #: classes/fields/class.field-datepicker.php:29 msgid "Date picker" msgstr "Seletor de data" #: classes/fields/class.field-datepicker.php:140 msgid "Date Format" msgstr "Formato de data" #: classes/fields/class.field-datepicker.php:148 msgid "e.g dd/mm/yy" msgstr "ex. dd/mm/yy" #: classes/fields/class.field-datepicker.php:158 msgid "Max Date" msgstr "Data máxima" #: classes/fields/class.field-datepicker.php:166 #: classes/fields/class.field-datepicker.php:184 msgid "e.g +1m +1w" msgstr "ex. +1m +1w" #: classes/fields/class.field-datepicker.php:176 msgid "Min Date" msgstr "Data mínima" #: classes/fields/class.field-file.php:21 msgid "File" msgstr "Arquivo" #: classes/fields/class.field-file.php:51 #: classes/fields/class.field-image.php:52 msgid "Delete" msgstr "Excluir" #: classes/fields/class.field-file.php:100 msgid "File Select" msgstr "Seleção de Arquivo" #: classes/fields/class.field-image.php:21 msgid "Image" msgstr "Imagem" #: classes/fields/class.field-image.php:94 msgid "Image Select" msgstr "Selecionar imagem" #: classes/fields/class.field-image.php:133 msgid "Preview Size" msgstr "Tamanho da pré-visualização" #: classes/fields/class.field-message.php:21 #: classes/fields/class.field-message.php:68 msgid "Message" msgstr "Mensagem" #: classes/fields/class.field-radio.php:21 msgid "Radio" msgstr "Radio" #: classes/fields/class.field-related-posts.php:24 msgid "Related Posts" msgstr "Posts Relacionados" #: classes/fields/class.field-related-posts.php:211 #: classes/fields/class.field-related-terms.php:209 msgid "Search..." msgstr "Pesquisa..." #: classes/fields/class.field-related-posts.php:256 #: classes/fields/class.field-related-terms.php:252 msgid "Selectable number" msgstr "Número selecionável" #: classes/fields/class.field-related-terms.php:24 msgid "Related Terms" msgstr "Termos relacionados" #: classes/fields/class.field-select.php:21 msgid "Select" msgstr "Seleção" #: classes/fields/class.field-text.php:21 #: classes/fields/class.field-wysiwyg.php:108 msgid "Text" msgstr "Texto" #: classes/fields/class.field-textarea.php:21 msgid "Textarea" msgstr "Área de Texto" #: classes/fields/class.field-textarea.php:71 msgid "Rows" msgstr "Linhas" #: classes/fields/class.field-wysiwyg.php:26 msgid "Wysiwyg" msgstr "Wysiwyg" #: classes/fields/class.field-wysiwyg.php:107 msgid "Visual" msgstr "Visual" #: classes/fields/class.field-wysiwyg.php:162 #: classes/fields/class.field-wysiwyg.php:163 msgid "Add Media" msgstr "Adicionar Mídia" #: classes/models/class.abstract-field-base.php:118 msgid "Name" msgstr "Nome" #: classes/models/class.abstract-field-base.php:134 msgid "Label" msgstr "Rótulo" #: classes/models/class.group.php:127 msgid "Repeat" msgstr "Repetir" #: classes/models/class.group.php:132 msgid "Group name" msgstr "Nome do grupo" #: classes/models/class.revisions.php:128 smart-custom-fields.php:174 #: smart-custom-fields.php:175 smart-custom-fields.php:176 msgid "Smart Custom Fields" msgstr "Smart Custom Fields" #: smart-custom-fields.php:177 smart-custom-fields.php:178 #: smart-custom-fields.php:224 smart-custom-fields.php:225 msgid "Add New" msgstr "Adicionar Novo" #: smart-custom-fields.php:179 msgid "New Field" msgstr "Novo Campo" #: smart-custom-fields.php:180 msgid "Edit Field" msgstr "Editar campo" #: smart-custom-fields.php:181 msgid "View Field" msgstr "Visualizar campo" #: smart-custom-fields.php:182 msgid "All Fields" msgstr "Todos os Campos" #: smart-custom-fields.php:183 msgid "Search Fields" msgstr "Campos de Pesquisa" #: smart-custom-fields.php:184 msgid "Parent Fields:" msgstr "Campos pai:" #: smart-custom-fields.php:185 msgid "No Fields found." msgstr "Nenhum campo encontrado." #: smart-custom-fields.php:186 msgid "No Fields found in Trash." msgstr "Nenhum campo encontrado na lixeira." #~ msgid "Post Ids ( Comma separated )" #~ msgstr "IDs de postagem (separados por vírgula)" #~ msgid "" #~ "Smart Custom Fields is a simple plugin that management custom fields." #~ msgstr "" #~ "Smart Custom Fields é um plugin simples que gerencia campos " #~ "personalizados." languages/smart-custom-fields-pt_BR.mo000064400000011143146726725200013770 0ustar00Ok         - ; GS[b#t      (M3        & 4 A P [ l y         + 6 ; D I g r y   r % 5 F U q         "/: j"%    &Q4       # D]c x   3J ] is (#*2 6 B OZ$4=9EH+? (!DF >70;5IJ6 <N1M/%,K: .C*")-OB#2@G8 &LA3 'Add FieldAdd MediaAdd NewAdd Sub fieldAll FieldsBasic fieldsBooleanCheckChoicesColor pickerContent fieldsCustom FieldsDate FormatDate pickerDefaultDeleteDisplay DirectionDisplay conditions ( Options page )Display conditions ( Post )Display conditions ( Profile )Display conditions ( Taxonomy )Edit FieldFALSE LabelFileFile SelectFile settingGroup nameIf you want to separate the key and the value, enter as follows: key => valueImageImage SelectImage settingInstructionLabelLoad moreLoading...Max DateMessageMin DateNameNew FieldNoNo Fields found in Trash.No Fields found.NotesOptions pagesOther fieldsParent Fields:Post TypesPost or Page IdsPreview SizeRadioRelated PostsRelated TermsRepeatRolesRowsSame name exists!Save settingsSearch FieldsSearch...SelectSelect fieldsSelectable numberSmart Custom FieldsTRUE LabelTaxonomiesTextTextareaTypeType to search a post or pageView FieldVisualWysiwygYese.g +1m +1we.g dd/mm/yyhorizontalverticalProject-Id-Version: Smart Custom Fields 3.1.7 Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-custom-fields POT-Creation-Date: 2018-07-14 22:36-0300 PO-Revision-Date: 2018-07-14 22:37-0300 Last-Translator: robssanches Language-Team: Português do Brasil Language: pt_BR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n != 1; X-Generator: Poedit 2.0.9 Plural-Forms: nplurals=1; plural=0; X-Poedit-KeywordsList: __;_e;esc_html__;esc_html_e;esc_attr__;esc_attr_e X-Poedit-Basepath: .. X-Poedit-SearchPath-0: . Adicionar CampoAdicionar MídiaAdicionar NovoAdicionar Campo SecundárioTodos os CamposCampos básicosVerdadeiro ou FalsoCheckboxOpçõesSeletor de coresCampos de conteúdoCampos personalizadosFormato de dataSeletor de dataPadrãoExcluirDireção de ExibiçãoCondições de exibição (Página de Opções)Condições de exibição (Post)Condições de exibição (Perfil)Condições de exibição (Taxonomia)Editar campoRótulo FALSOArquivoSeleção de ArquivoConfiguração de arquivoNome do grupoSe você deseja separar a chave e o valor, insira da seguinte forma: key => valueImagemSelecionar imagemConfiguração de imagemInstruçãoRótuloCarregar maisCarregando...Data máximaMensagemData mínimaNomeNovo CampoNãoNenhum campo encontrado na lixeira.Nenhum campo encontrado.NotasPáginas de opçõesOutros camposCampos pai:Tipos de PostIDs de Posts ou PáginasTamanho da pré-visualizaçãoRadioPosts RelacionadosTermos relacionadosRepetirFunçõesLinhasO mesmo nome existe!Salvar configuraçõesCampos de PesquisaPesquisa...SeleçãoSelecione os camposNúmero selecionávelSmart Custom FieldsRótulo VERDADEIROTaxonomiasTextoÁrea de TextoTipoDigite para pesquisar um post ou páginaVisualizar campoVisualWysiwygSimex. +1m +1wex. dd/mm/yyhorizontalverticallanguages/smart-custom-fields-ja.mo000064400000011327146726725200013360 0ustar00Mg         #+2#Dh     MQ W d r~      2 = J P ^ l s y ~        % , 4 8 D Q \ Te     . D N g q       *@$Y$~ ` m t      ? 3I}(; Q^e!l * =J `j    #HF2 M;G6J) C@7&?4A5,% .> :B=3*!D(1I$+EL'" 9K-</80Add FieldAdd MediaAdd NewAdd Sub fieldAll FieldsBasic fieldsBooleanCheckChoicesColor pickerContent fieldsCustom FieldsDate FormatDate pickerDefaultDeleteDisplay DirectionDisplay conditions ( Options page )Display conditions ( Post )Display conditions ( Profile )Display conditions ( Taxonomy )Edit FieldFALSE LabelFileFile SelectFile settingGroup nameIf you want to separate the key and the value, enter as follows: key => valueImageImage SelectImage settingInstructionLabelLoad moreMax DateMessageMin DateNameNew FieldNoNo Fields found in Trash.No Fields found.NotesOptions pagesOther fieldsParent Fields:Post Ids ( Comma separated )Post TypesPreview SizeRadioRelated PostsRelated TermsRepeatRolesRowsSame name exists!Save settingsSearch FieldsSearch...SelectSelect fieldsSelectable numberSmart Custom FieldsTRUE LabelTaxonomiesTextTextareaTypeView FieldVisualWysiwygYese.g +1m +1we.g dd/mm/yyhorizontalverticalProject-Id-Version: Smart Custom Fields 3.1.7 Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-custom-fields POT-Creation-Date: 2018-06-26 09:22+0900 PO-Revision-Date: 2018-06-26 09:22+0900 Last-Translator: inc2734 Language-Team: Japanese Language: ja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n != 1; X-Generator: Poedit 2.0.4 Plural-Forms: nplurals=1; plural=0; X-Poedit-KeywordsList: __;_e;esc_html__;esc_html_e;esc_attr__;esc_attr_e X-Poedit-Basepath: .. X-Poedit-SearchPath-0: . フィールド追加メディアを追加新規追加サブフィールドを追加すべてのフィールド基本フィールド真偽値チェックボックス選択肢カラーピッカーコンテンツフィールドカスタムフィールド日付のフォーマット日付ピッカーデフォルト削除表示方向表示条件(オプションページ)表示条件(投稿)表示条件(プロフィール)表示条件(タクソノミー)フィールド編集FALSE ラベルファイルファイル選択ファイル設定グループ名もしキーと値を分けたい場合は次のように入力してください: キー => 値画像画像選択画像設定説明文ラベルさらに読み込む最大日付メッセージ最小日付名前新規フィールドいいえゴミ箱にフィールドは見つかりませんでした。フィールドは見つかりませんでした。注記オプションページその他のフィールド親フィールド:投稿 ID (カンマ区切り)投稿タイププレビューサイズラジオボタン関連する投稿関連するターム繰り返し権限行数同じ名前が存在します!設定を保存フィールドを検索検索 …セレクトボックス選択フィールド選択できる個数Smart Custom FieldsTRUE ラベルタクソノミーテキストテキストエリアタイプフィールドを表示ビジュアルWYSIWYGはい例: +1m +1w例: dd/mm/yy水平方向垂直方向classes/class.rest-api.php000064400000002725146726725200011563 0ustar00 'GET', 'callback' => array( $this, 'get_all_posts' ), 'permission_callback' => function () { return current_user_can( 'edit_posts' ); }, ) ); } /** * Get all posts and pages */ public function get_all_posts() { $all_posts = get_posts( array( 'post_type' => $this->get_post_type(), 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'ASC', 'posts_per_page' => -1, // all posts ) ); if ( $all_posts ) { $source = array(); foreach ( $all_posts as $k => $post ) { $source[ $k ]['id'] = $post->ID; $source[ $k ]['text'] = $post->ID . ' - ' . $post->post_title; } } return $source; } /** * Get posts type. */ public function get_post_type() { $post_type = $this->post_type; return apply_filters( SCF_Config::PREFIX . 'rest_api_post_type', $post_type ); } } classes/fields/class.field-related-terms.php000064400000021756146726725200015143 0ustar00 'taxonomy', 'display-name' => __( 'Related Terms', 'smart-custom-fields' ), 'optgroup' => 'other-fields', 'allow-multiple-data' => true, ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'taxonomy' => '', 'limit' => 0, 'instruction' => '', 'notes' => '', ); } /** * Loading resources. */ public function admin_enqueue_scripts() { wp_enqueue_script( SCF_Config::PREFIX . 'editor-relation-common', SMART_CUSTOM_FIELDS_URL . '/js/editor-relation-common.js', array( 'jquery' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/editor-relation-common.js' ), true ); wp_enqueue_script( SCF_Config::PREFIX . 'editor-relation-taxonomies', SMART_CUSTOM_FIELDS_URL . '/js/editor-relation-taxonomies.js', array( 'jquery' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/editor-relation-taxonomies.js' ), true ); wp_localize_script( SCF_Config::PREFIX . 'editor-relation-taxonomies', 'smart_cf_relation_taxonomies', array( 'endpoint' => admin_url( 'admin-ajax.php' ), 'action' => SCF_Config::PREFIX . 'relational-terms-search', 'nonce' => wp_create_nonce( SCF_Config::NAME . '-relation-taxonomies' ), ) ); } /** * Process that loading post when clicking post load button. */ public function relational_terms_search() { check_ajax_referer( SCF_Config::NAME . '-relation-taxonomies', 'nonce' ); $_terms = array(); $taxonomies = filter_input( INPUT_POST, 'taxonomies' ); if ( $taxonomies ) { $taxonomies = explode( ',', $taxonomies ); $retrievable_taxonomies = array(); foreach ( $taxonomies as $_taxonomy ) { $tax = get_taxonomy( $_taxonomy ); if ( current_user_can( $tax->cap->manage_terms ) ) { $retrievable_taxonomies[] = $_taxonomy; } } if ( $retrievable_taxonomies ) { $args = array( 'taxonomy' => $retrievable_taxonomies, 'order' => 'ASC', 'orderby' => 'ID', 'number' => '', 'hide_empty' => false, 'hierarchical' => false, ); $click_count = filter_input( INPUT_POST, 'click_count' ); if ( $click_count ) { $number = get_option( 'posts_per_page' ); $offset = $click_count * $number; $args = array_merge( $args, array( 'offset' => $offset, 'number' => $number, ) ); } $search = filter_input( INPUT_POST, 'search' ); if ( $search ) { $args = array_merge( $args, array( 'search' => $search, ) ); } $_terms = get_terms( $args ); } } header( 'Content-Type: application/json; charset=utf-8' ); echo wp_json_encode( $_terms ); die(); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $taxonomies = $this->get( 'taxonomy' ); $limit = $this->get( 'limit' ); $choices_terms = array(); $number = get_option( 'posts_per_page' ); if ( $taxonomies ) { $retrievable_taxonomies = array(); foreach ( $taxonomies as $_taxonomy ) { $tax = get_taxonomy( $_taxonomy ); if ( current_user_can( $tax->cap->manage_terms ) ) { $retrievable_taxonomies[] = $_taxonomy; } } if ( $retrievable_taxonomies ) { if ( ! preg_match( '/^\d+$/', $limit ) ) { $limit = ''; } // choicse $choices_terms = get_terms( array( 'taxonomy' => $taxonomies, 'order' => 'ASC', 'orderby' => 'ID', 'hide_empty' => false, 'hierarchical' => false, 'number' => $number, ) ); } } $choices_li = array(); foreach ( $choices_terms as $_term ) { $term_name = $_term->name; if ( empty( $term_name ) ) { $term_name = ' '; } $choices_li[] = sprintf( '
  • %s
  • ', $_term->term_id, $term_name ); } // selected $selected_terms = array(); if ( ! empty( $value ) && is_array( $value ) ) { foreach ( $value as $term_id ) { $term_name = get_term( $term_id )->name; if ( empty( $term_name ) ) { $term_name = ' '; } $selected_terms[ $term_id ] = $term_name; } } $selected_li = array(); $hidden = array(); foreach ( $selected_terms as $term_id => $term_name ) { $selected_li[] = sprintf( '
  • %s-
  • ', $term_id, esc_attr( SCF_Config::PREFIX . 'icon-handle dashicons dashicons-menu' ), $term_name ); $hidden[] = sprintf( '', esc_attr( $name . '[]' ), $term_id, disabled( true, $disabled, false ) ); } $hide_class = ''; if ( count( $choices_li ) < $number ) { $hide_class = 'hide'; } return sprintf( '
      %s

    %s

    %s
      %s
    ', SCF_Config::PREFIX . 'relation-left', implode( ',', $taxonomies ), $limit, SCF_Config::PREFIX . 'search', esc_attr__( 'Search...', 'smart-custom-fields' ), SCF_Config::PREFIX . 'relation-children-select', implode( '', $choices_li ), $hide_class, esc_html__( 'Load more', 'smart-custom-fields' ), esc_attr( $name ), disabled( true, $disabled, false ), implode( '', $hidden ), SCF_Config::PREFIX . 'relation-right', implode( '', $selected_li ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> true, ), 'objects' ); ?> $taxonomy_object ) : ?> get( 'taxonomy' ); ?> checked="checked" />labels->singular_name ); ?> get_attribute( 'type' ) ) { $validated_value = array(); foreach ( $value as $term ) { $validated_value[] = $term; } $value = $validated_value; } return $value; } } classes/fields/class.field-text.php000064400000004571146726725200013353 0ustar00 'text', 'display-name' => __( 'Text', 'smart-custom-fields' ), 'optgroup' => 'basic-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); return sprintf( '', esc_attr( $name ), esc_attr( $value ), disabled( true, $disabled, false ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> 'relation', 'display-name' => __( 'Related Posts', 'smart-custom-fields' ), 'optgroup' => 'other-fields', 'allow-multiple-data' => true, ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'post-type' => '', 'limit' => 0, 'instruction' => '', 'notes' => '', ); } /** * Loading resources. */ public function admin_enqueue_scripts() { wp_enqueue_script( SCF_Config::PREFIX . 'editor-relation-common', SMART_CUSTOM_FIELDS_URL . '/js/editor-relation-common.js', array( 'jquery' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/editor-relation-common.js' ), true ); wp_enqueue_script( SCF_Config::PREFIX . 'editor-relation-post-types', SMART_CUSTOM_FIELDS_URL . '/js/editor-relation-post-types.js', array( 'jquery' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/editor-relation-post-types.js' ), true ); wp_localize_script( SCF_Config::PREFIX . 'editor-relation-post-types', 'smart_cf_relation_post_types', array( 'endpoint' => admin_url( 'admin-ajax.php' ), 'action' => SCF_Config::PREFIX . 'relational-posts-search', 'nonce' => wp_create_nonce( SCF_Config::NAME . '-relation-post-types' ), ) ); } /** * Process that loading post when clicking post load button. */ public function relational_posts_search() { check_ajax_referer( SCF_Config::NAME . '-relation-post-types', 'nonce' ); $_posts = array(); $post_types = filter_input( INPUT_POST, 'post_types' ); if ( $post_types ) { $post_type = explode( ',', $post_types ); $retrievable_post_types = array(); foreach ( $post_type as $_post_type ) { $post_type_object = get_post_type_object( $_post_type ); if ( current_user_can( $post_type_object->cap->edit_posts ) ) { $retrievable_post_types[] = $_post_type; } } if ( $retrievable_post_types ) { $args = array( 'post_type' => $retrievable_post_types, 'order' => 'ASC', 'orderby' => 'ID', 'posts_per_page' => -1, 'post_status' => 'any', ); $click_count = filter_input( INPUT_POST, 'click_count' ); if ( $click_count ) { $posts_per_page = get_option( 'posts_per_page' ); $offset = $click_count * $posts_per_page; $args = array_merge( $args, array( 'offset' => $offset, 'posts_per_page' => $posts_per_page, ) ); } $s = filter_input( INPUT_POST, 's' ); if ( $s ) { $args = array_merge( $args, array( 's' => $s, ) ); } $field_name = sanitize_text_field( filter_input( INPUT_POST, 'field_name' ) ); /** * This filter will be always applied when it queries posts in related posts field. */ $args = apply_filters( SCF_Config::PREFIX . 'custom_related_posts_args', $args, $field_name, $post_type ); /** * This filter will only be applied when getting posts via ajax call, therefore it won't be applied for the first load. */ $args = apply_filters( SCF_Config::PREFIX . 'custom_related_posts_args_ajax_call', $args, $field_name, $post_type ); $_posts = get_posts( $args ); } } header( 'Content-Type: application/json; charset=utf-8' ); echo wp_json_encode( $_posts ); die(); } /** * Getting the field. * * @param int $index Field index. * @param array $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $post_type = $this->get( 'post-type' ); $limit = $this->get( 'limit' ); $choices_posts = array(); $posts_per_page = get_option( 'posts_per_page' ); if ( $post_type ) { $retrievable_post_types = array(); foreach ( $post_type as $_post_type ) { $post_type_object = get_post_type_object( $_post_type ); if ( current_user_can( $post_type_object->cap->edit_posts ) ) { $retrievable_post_types[] = $_post_type; } } if ( $retrievable_post_types ) { if ( ! preg_match( '/^\d+$/', $limit ) ) { $limit = ''; } $args = array( 'post_type' => $retrievable_post_types, 'order' => 'ASC', 'orderby' => 'ID', 'posts_per_page' => $posts_per_page, 'post_status' => 'any', ); /** * This filter will be always applied when it queries posts in related posts field. */ $args = apply_filters( SCF_Config::PREFIX . 'custom_related_posts_args', $args, $name, $post_type ); /** * This filter will only be applied in the first load, therefore it won't be applied when getting posts via ajax call. */ $args = apply_filters( SCF_Config::PREFIX . 'custom_related_posts_args_first_load', $args, $name, $post_type ); // Get posts to show in the first load. $choices_posts = get_posts( $args ); } } $choices_li = array(); foreach ( $choices_posts as $_post ) { $post_title = get_the_title( $_post->ID ); if ( empty( $post_title ) ) { $post_title = ' '; } $choices_li[] = sprintf( '
  • %s
  • ', $_post->ID, $_post->post_status, $post_title ); } // selected $selected_posts = array(); if ( ! empty( $value ) && is_array( $value ) ) { foreach ( $value as $post_id ) { $post_title = get_the_title( $post_id ); if ( empty( $post_title ) ) { $post_title = ' '; } $selected_posts[ $post_id ] = $post_title; } } $selected_li = array(); $hidden = array(); foreach ( $selected_posts as $post_id => $post_title ) { $selected_li[] = sprintf( '
  • %s-
  • ', $post_id, get_post_status( $post_id ), esc_attr( SCF_Config::PREFIX . 'icon-handle dashicons dashicons-menu' ), $post_title ); $hidden[] = sprintf( '', esc_attr( $name . '[]' ), $post_id, disabled( true, $disabled, false ) ); } $hide_class = ''; if ( count( $choices_li ) < $posts_per_page ) { $hide_class = 'hide'; } return sprintf( '
      %s

    %s

    %s
      %s
    ', SCF_Config::PREFIX . 'relation-left', implode( ',', $post_type ), $limit, SCF_Config::PREFIX . 'search', esc_attr__( 'Search...', 'smart-custom-fields' ), SCF_Config::PREFIX . 'relation-children-select', implode( '', $choices_li ), $hide_class, esc_html__( 'Load more', 'smart-custom-fields' ), esc_attr( $name ), disabled( true, $disabled, false ), implode( '', $hidden ), SCF_Config::PREFIX . 'relation-right', implode( '', $selected_li ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> true, ), 'objects' ); unset( $post_types['attachment'] ); unset( $post_types['wp_block'] ); unset( $post_types[ SCF_Config::NAME ] ); ?> $post_type_object ) : ?> get( 'post-type' ); ?> checked="checked" />labels->singular_name ); ?> get_attribute( 'type' ) ) { $validated_value = array(); foreach ( $value as $post_id ) { $validated_value[] = $post_id; } $value = $validated_value; } return $value; } } classes/fields/class.field-textarea.php000064400000005440146726725200014200 0ustar00 'textarea', 'display-name' => __( 'Textarea', 'smart-custom-fields' ), 'optgroup' => 'basic-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'rows' => 5, 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $rows = $this->get( 'rows' ); return sprintf( '', esc_attr( $name ), esc_attr( $rows ), disabled( true, $disabled, false ), esc_textarea( $value ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> */ /** * Smart_Custom_Fields_Field_Datetime_Picker class. * * @since 4.x */ class Smart_Custom_Fields_Field_Datetime_Picker extends Smart_Custom_Fields_Field_Base { /** * Set the required items. * * @return array */ protected function init() { add_action( SCF_Config::PREFIX . 'before-editor-enqueue-scripts', array( $this, 'editor_enqueue_scripts' ) ); add_action( SCF_Config::PREFIX . 'before-settings-enqueue-scripts', array( $this, 'settings_enqueue_scripts' ) ); return array( 'type' => 'datetime_picker', 'display-name' => __( 'Datetime picker', 'smart-custom-fields' ), 'optgroup' => 'other-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'date_format' => '', 'max_date' => '', 'min_date' => '', 'time_24hr' => '', 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Loading resources for editor. */ public function editor_enqueue_scripts() { wp_enqueue_style( 'flatpickr-style', '//cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css', array(), 1 ); wp_enqueue_script( 'flatpickr-script', '//cdn.jsdelivr.net/npm/flatpickr', array(), 1, true ); wp_enqueue_script( SCF_Config::PREFIX . 'flatpickr-script', SMART_CUSTOM_FIELDS_URL . '/js/settings-datetime-picker.js', array( 'flatpickr-script' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/settings-datetime-picker.js' ), true ); $locale = $this->get_locale_name(); if ( $locale ) { wp_enqueue_script( "flatpickr-lang-{$locale}", "//npmcdn.com/flatpickr/dist/l10n/{$locale}.js", array(), 1, true ); } } /** * Loading resources for editor for custom field settings page. */ public function settings_enqueue_scripts() { wp_enqueue_style( 'flatpickr-style', '//cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css', array(), 1 ); wp_enqueue_script( 'flatpickr-script', '//cdn.jsdelivr.net/npm/flatpickr', array(), 1, true ); wp_enqueue_script( SCF_Config::PREFIX . 'flatpickr-script', SMART_CUSTOM_FIELDS_URL . '/js/settings-datetime-picker.js', array( 'flatpickr-script' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/settings-datetime-picker.js' ), true ); $locale = $this->get_locale_name(); if ( $locale ) { wp_enqueue_script( "flatpickr-lang-{$locale}", "//npmcdn.com/flatpickr/dist/l10n/{$locale}.js", array(), 1, true ); } } /** * Get the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $data_js = $this->get_data_js(); return ''; } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?>
    ', '' ); esc_html_e( 'This datetime picker currently does not include the timezone support, therefore you need to include some information on the instruction field below to enforce everyone to use the same timezone. The value returned by this field is always a plain text of date string.', 'smart-custom-fields' ); ?>
    ', '' ); ?>
    ', '' ); ?>
    get_locale_name() ) { $data['locale'] = $this->get_locale_name(); } if ( $this->get( 'date_format' ) ) { $data['dateFormat'] = $this->get( 'date_format' ); } if ( $this->get( 'max_date' ) ) { $data['maxDate'] = $this->get( 'max_date' ); } if ( $this->get( 'min_date' ) ) { $data['minDate'] = $this->get( 'min_date' ); } if ( $this->get( 'time_24hr' ) ) { $data['time_24hr'] = $this->get( 'time_24hr' ); } $data = apply_filters( SCF_Config::PREFIX . 'datetime_picker_data', $data ); return wp_json_encode( $data ); } /** * Return locale name for flatpickr. * * @return false|string $locale Locale. */ private function get_locale_name() { /** * The locale list is hardcoded here. Because of this, when flatpickr adds support for new language it's required to update the list. * * The list is from: https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts * Or at https://github.com/flatpickr/flatpickr/tree/master/src/l10n , * run the following script and copy the result: * const list = document.querySelectorAll('.files .content > span > a'); const items = []; for (const item of list) { items.push(item.innerHTML.split('.')[0]) }; console.log(items) */ $supported_locales = array( 'ar', 'at', 'be', 'bg', 'bn', 'cat', 'cs', 'cy', 'da', 'de', 'eo', 'es', 'et', 'fa', 'fi', 'fo', 'fr', 'gr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'km', 'ko', 'kz', 'lt', 'lv', 'mk', 'mn', 'ms', 'my', 'nl', 'no', 'pa', 'pl', 'pt', 'ro', 'ru', 'si', 'sk', 'sl', 'sq', 'sr', 'sv', 'th', 'tr', 'uk', 'vn', 'zh', ); $wp_locale = get_locale(); if ( strpos( $wp_locale, '_' ) ) { $_user_lang = explode( $wp_locale, '_' ); $user_lang = $_user_lang[0]; } else { $user_lang = $wp_locale; } if ( in_array( $user_lang, $supported_locales, true ) ) { return $user_lang; } return false; } } classes/fields/class.field-file.php000064400000007057146726725200013310 0ustar00 'file', 'display-name' => __( 'File', 'smart-custom-fields' ), 'optgroup' => 'content-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'instruction' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $btn_remove = sprintf( '%s', esc_html__( 'Delete', 'smart-custom-fields' ) ); $hide_class = 'hide'; $image = $btn_remove; if ( $value ) { // Usually, $value is attachment ID. // If a customized, for example, $value is not an ID, // Regarded the $value is file URL. if ( preg_match( '/^\d+$/', $value ) ) { $image_src = wp_get_attachment_image_src( $value, 'thumbnail', true ); $image_alt = get_the_title( $value ); if ( is_array( $image_src ) && isset( $image_src[0] ) ) { $image_src = $image_src[0]; } } else { $image_url = $value; $path = str_replace( home_url(), '', $value ); $image_path = ABSPATH . untrailingslashit( $path ); if ( file_exists( $image_path ) ) { $wp_check_filetype = wp_check_filetype( $image_path ); if ( ! empty( $wp_check_filetype['type'] ) ) { $image_src = $image_url; } } } if ( $image_src && ! is_array( $image_src ) ) { $filename = wp_basename( get_attached_file( $value ) ); $image = sprintf( '%s%s%s', wp_get_attachment_url( $value ), esc_url( $image_src ), $image_alt, esc_attr( $filename ), $btn_remove ); $hide_class = ''; } } return sprintf( '%s
    %s ', esc_html__( 'File Select', 'smart-custom-fields' ), esc_attr( SCF_Config::PREFIX . 'upload-file' ), esc_attr( $hide_class ), $image, esc_attr( $name ), esc_attr( $value ), disabled( true, $disabled, false ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> 'boolean', 'display-name' => __( 'Boolean', 'smart-custom-fields' ), 'optgroup' => 'basic-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'default' => 0, 'instruction' => '', 'notes' => '', 'true_label' => __( 'Yes', 'smart-custom-fields' ), 'false_label' => __( 'No', 'smart-custom-fields' ), ); } /** * Getting the field. * * @param int $index Field index. * @param int $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $value = ( true === $value || 1 === $value || '1' === $value ) ? 1 : 0; $true = sprintf( '', esc_attr( $name ), checked( 1, $value, false ), disabled( true, $disabled, false ), $this->get( 'true_label' ) ); $false = sprintf( '', esc_attr( $name ), checked( 0, $value, false ), disabled( true, $disabled, false ), $this->get( 'false_label' ) ); return $true . $false; } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?>
     
    get_attribute( 'type' ) ) { if ( is_array( $value ) ) { foreach ( $value as $key => $val ) { $value[ $key ] = ! ! $val; } } else { $value = ! ! $value; } } return $value; } } classes/fields/class.field-radio.php000064400000010233146726725200013455 0ustar00 'radio', 'display-name' => __( 'Radio', 'smart-custom-fields' ), 'optgroup' => 'select-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'choices' => '', 'radio_direction' => 'horizontal', // or vertical 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $choices = SCF::choices_eol_to_array( $this->get( 'choices' ) ); $direction = $this->get( 'radio_direction' ); $form_field = sprintf( '', esc_attr( $name ), disabled( true, $disabled, false ) ); foreach ( $choices as $key => $choice ) { $choice = trim( $choice ); if ( ! SCF::is_assoc( $choices ) ) { $key = $choice; } $form_field .= sprintf( '', esc_attr( SCF_Config::PREFIX . 'item-' . $direction ), esc_attr( $name ), esc_attr( $key ), checked( $value, $key, false ), disabled( true, $disabled, false ), esc_html( $choice ) ); } return $form_field; } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> value', 'smart-custom-fields' ); ?> __( 'horizontal', 'smart-custom-fields' ), 'vertical' => __( 'vertical', 'smart-custom-fields' ), ); foreach ( $directions as $key => $value ) { printf( '   ', esc_attr( $this->get_field_name_in_setting( $group_key, $field_key, 'radio_direction' ) ), esc_attr( $key ), checked( $this->get( 'radio_direction' ), $key, false ), esc_html( $value ) ); } ?> 'check', 'display-name' => __( 'Check', 'smart-custom-fields' ), 'optgroup' => 'select-fields', 'allow-multiple-data' => true, ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'choices' => '', 'check_direction' => 'horizontal', // or vertical 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param array $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $choices = SCF::choices_eol_to_array( $this->get( 'choices' ) ); $direction = $this->get( 'check_direction' ); $form_field = sprintf( '', esc_attr( $name ), disabled( true, $disabled, false ) ); foreach ( $choices as $key => $choice ) { $choice = trim( $choice ); if ( ! SCF::is_assoc( $choices ) ) { $key = $choice; } $form_field .= sprintf( '', esc_attr( SCF_Config::PREFIX . 'item-' . $direction ), esc_attr( $name . '[]' ), esc_attr( $key ), checked( true, is_array( $value ) && in_array( $key, $value, true ), false ), disabled( true, $disabled, false ), esc_html( $choice ) ); } return $form_field; } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> value', 'smart-custom-fields' ); ?> __( 'horizontal', 'smart-custom-fields' ), 'vertical' => __( 'vertical', 'smart-custom-fields' ), ); foreach ( $directions as $key => $value ) { printf( '   ', esc_attr( $this->get_field_name_in_setting( $group_key, $field_key, 'check_direction' ) ), esc_attr( $key ), checked( $this->get( 'check_direction' ), $key, false ), esc_html( $value ) ); } ?> 'select', 'display-name' => __( 'Select', 'smart-custom-fields' ), 'optgroup' => 'select-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'choices' => '', 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $choices = SCF::choices_eol_to_array( $this->get( 'choices' ) ); $form_field = ''; foreach ( $choices as $key => $choice ) { $choice = trim( $choice ); if ( ! SCF::is_assoc( $choices ) ) { $key = $choice; } $form_field .= sprintf( '', esc_attr( $key ), selected( $value, $key, false ), esc_html( $choice ) ); } return sprintf( '', esc_attr( $name ), disabled( true, $disabled, false ), $form_field ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> value', 'smart-custom-fields' ); ?> 'datepicker', 'display-name' => __( 'Date picker', 'smart-custom-fields' ), 'optgroup' => 'other-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'date_format' => '', 'max_date' => '', 'min_date' => '', 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Loading resources for editor. */ public function editor_enqueue_scripts() { global $wp_scripts; $ui = $wp_scripts->query( 'jquery-ui-core' ); wp_enqueue_style( 'jquery.ui', '//ajax.googleapis.com/ajax/libs/jqueryui/' . $ui->ver . '/themes/smoothness/jquery-ui.min.css', array(), $ui->ver ); wp_enqueue_script( 'jquery-ui-datepicker' ); wp_enqueue_script( SCF_Config::PREFIX . 'editor-datepicker', SMART_CUSTOM_FIELDS_URL . '/js/editor-datepicker.js', array( 'jquery', 'jquery-ui-datepicker' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/editor-datepicker.js' ), true ); } /** * Loading resources for editor for custom field settings page. */ public function settings_enqueue_scripts() { global $wp_scripts; $ui = $wp_scripts->query( 'jquery-ui-core' ); wp_enqueue_style( 'jquery.ui', '//ajax.googleapis.com/ajax/libs/jqueryui/' . $ui->ver . '/themes/smoothness/jquery-ui.min.css', array(), $ui->ver ); wp_enqueue_script( 'jquery-ui-datepicker' ); wp_enqueue_script( SCF_Config::PREFIX . 'settings-datepicker', SMART_CUSTOM_FIELDS_URL . '/js/settings-datepicker.js', array( 'jquery', 'jquery-ui-datepicker' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/settings-datepicker.js' ), true ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $data_js = $this->get_data_js(); return sprintf( '', esc_attr( $name ), esc_attr( $value ), esc_attr( SCF_Config::PREFIX . 'datepicker' ), disabled( true, $disabled, false ), $data_js ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?>
    , %2$s: esc_html__( 'Prease see %1$sdateFormat%1$s', 'smart-custom-fields' ), '', '' ); ?>
    , %2$s: esc_html__( 'Prease see %1$smaxData%2$s', 'smart-custom-fields' ), '', '' ); ?>
    , %2$s: esc_html__( 'Prease see %1$sminData%2$s', 'smart-custom-fields' ), '', '' ); ?> true, 'changeYear' => true, 'changeMonth' => true, ); // If locale is Japanese, change in Japanese notation if ( get_locale() === 'ja' ) { $js = array_merge( $js, array( 'yearSuffix' => '年', 'dateFormat' => 'yy-mm-dd', 'dayNames' => array( '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', ), 'dayNamesMin' => array( '日', '月', '火', '水', '木', '金', '土', ), 'dayNamesShort' => array( '日曜', '月曜', '火曜', '水曜', '木曜', '金曜', '土曜', ), 'monthNames' => array( '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ), 'monthNamesShort' => array( '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ), ) ); } if ( $this->get( 'date_format' ) ) { $js['dateFormat'] = $this->get( 'date_format' ); } if ( $this->get( 'max_date' ) ) { $js['maxDate'] = $this->get( 'max_date' ); } if ( $this->get( 'min_date' ) ) { $js['minDate'] = $this->get( 'min_date' ); } return wp_json_encode( $js ); } } classes/fields/class.field-wysiwyg.php000064400000014434146726725200014110 0ustar00 'wysiwyg', 'display-name' => __( 'Wysiwyg', 'smart-custom-fields' ), 'optgroup' => 'content-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Loading js after loading TinyMCE in editor page. */ public function editor_enqueue_scripts() { add_action( 'after_wp_tiny_mce', array( $this, 'after_wp_tiny_mce' ) ); } /** * Add script for wysiwyg. */ public function after_wp_tiny_mce() { // phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedScript printf( '', esc_url( plugins_url( SCF_Config::NAME ) . '/js/editor-wysiwyg.js' ) ); // phpcs:enable } /** * Processing to be executed immediately after the field initialization. * If not exec this, taxonomy and profile wysiwyg has js error. */ protected function after_loaded() { add_action( 'admin_footer', array( $this, 'admin_footer' ) ); } /** * Add dummy editor. */ public function admin_footer() { ?>
    get_field_name_in_editor( $index ); $wysiwyg_id = str_replace( array( '[', ']', '-' ), '_', $name ); $disabled = $this->get_disable_attribute( $index ); $value = format_for_editor( $value ); return sprintf( '
    %1$s
    ', $this->media_buttons( $wysiwyg_id ), esc_attr( $wysiwyg_id ), esc_attr( $name ), disabled( true, $disabled, false ), $value, esc_html__( 'Visual', 'smart-custom-fields' ), esc_html__( 'Text', 'smart-custom-fields' ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> '; return sprintf( '%s', esc_attr( $editor_id ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain esc_attr__( 'Add Media' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain $img . __( 'Add Media' ) ); } /** * Validating when displaying meta data. * * @param mixed $value The value. * @param string $field_type Field type. * @return string|array */ public function validate_get_value( $value, $field_type ) { if ( $field_type === $this->get_attribute( 'type' ) ) { if ( is_array( $value ) ) { $validated_value = array(); foreach ( $value as $k => $v ) { $validated_value[ $k ] = $this->add_the_content_filter( $v ); } $value = $validated_value; } else { $value = $this->add_the_content_filter( $value ); } } return $value; } /** * Hooking functions that is hooked to the_content. * * @param string $value The value. * @return string */ protected function add_the_content_filter( $value ) { if ( has_filter( 'the_content', 'wptexturize' ) ) { $value = wptexturize( $value ); } if ( has_filter( 'the_content', 'convert_smilies' ) ) { $value = convert_smilies( $value ); } if ( has_filter( 'the_content', 'convert_chars' ) ) { $value = convert_chars( $value ); } if ( has_filter( 'the_content', 'wpautop' ) ) { $value = wpautop( $value ); } if ( has_filter( 'the_content', 'shortcode_unautop' ) ) { $value = shortcode_unautop( $value ); } if ( has_filter( 'the_content', 'prepend_attachment' ) ) { $value = prepend_attachment( $value ); } return $value; } } classes/fields/class.field-image.php000064400000010036146726725200013442 0ustar00 'image', 'display-name' => __( 'Image', 'smart-custom-fields' ), 'optgroup' => 'content-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'instruction' => '', 'notes' => '', 'size' => 'full', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); $btn_remove = sprintf( '%s', esc_html__( 'Delete', 'smart-custom-fields' ) ); $hide_class = 'hide'; $image = $btn_remove; if ( $value ) { // Usually, $value is attachment ID. // If a customized, for example, $value is not an ID, // Regarded the $value is file URL. if ( preg_match( '/^\d+$/', $value ) ) { $image_src = wp_get_attachment_image_src( $value, $this->get( 'size' ) ); $image_alt = get_the_title( $value ); if ( is_array( $image_src ) && isset( $image_src[0] ) ) { $image_src = $image_src[0]; } } else { $image_url = $value; $path = str_replace( home_url(), '', $value ); $image_path = ABSPATH . untrailingslashit( $path ); if ( file_exists( $image_path ) ) { $wp_check_filetype = wp_check_filetype( $image_path ); if ( ! empty( $wp_check_filetype['type'] ) ) { $image_src = $image_url; } } } if ( $image_src && ! is_array( $image_src ) ) { $image = sprintf( '%s%s', esc_url( $image_src ), $image_alt, $btn_remove ); $hide_class = ''; } } return sprintf( '%s
    %s ', esc_html__( 'Image Select', 'smart-custom-fields' ), esc_attr( SCF_Config::PREFIX . 'upload-image' ), esc_attr( $hide_class ), esc_attr( $this->get( 'size' ) ), $image, esc_attr( $name ), esc_attr( $value ), disabled( true, $disabled, false ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> 'message', 'display-name' => __( 'Message', 'smart-custom-fields' ), 'optgroup' => 'basic-fields', 'allow-multiple-data' => false, 'layout' => 'full-width', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'default' => '', 'notes' => '', ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); return sprintf( '
    %s
    ', esc_attr( $name ), disabled( true, $disabled, false ), $value ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_name_option( $group_key, $field_key ); ?> 'colorpicker', 'display-name' => __( 'Color picker', 'smart-custom-fields' ), 'optgroup' => 'other-fields', ); } /** * Set the non required items. * * @return array */ protected function options() { return array( 'default' => '', 'instruction' => '', 'notes' => '', ); } /** * Loading resources for editor. */ public function editor_enqueue_scripts() { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( SCF_Config::PREFIX . 'editor-colorpicker', SMART_CUSTOM_FIELDS_URL . '/js/editor-colorpicker.js', array( 'jquery', 'wp-color-picker' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/editor-colorpicker.js' ), true ); } /** * Loading resources for editor for custom field settings page. */ public function settings_enqueue_scripts() { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( SCF_Config::PREFIX . 'settings-colorpicker', SMART_CUSTOM_FIELDS_URL . '/js/settings-colorpicker.js', array( 'jquery', 'wp-color-picker' ), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/settings-colorpicker.js' ), true ); } /** * Getting the field. * * @param int $index Field index. * @param string $value The value. * @return string */ public function get_field( $index, $value ) { $name = $this->get_field_name_in_editor( $index ); $disabled = $this->get_disable_attribute( $index ); return sprintf( '', esc_attr( $name ), esc_attr( $value ), esc_attr( SCF_Config::PREFIX . 'colorpicker' ), disabled( true, $disabled, false ) ); } /** * Displaying the option fields in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_field_options( $group_key, $field_key ) { $this->display_label_option( $group_key, $field_key ); $this->display_name_option( $group_key, $field_key ); ?> get_meta( $wp_object, $name ) ) { self::debug_cache_message( "use get cache. [name: {$name}]" ); return $cache->get_meta( $wp_object, $name ); } else { self::debug_cache_message( "dont use get cache... [name: {$name}]" ); } $settings = self::get_settings( $wp_object ); foreach ( $settings as $setting ) { // If $name matches the group name, returns fields in the group as array. $group = $setting->get_group( $name ); if ( $group ) { $values_by_group = self::get_values_by_group( $wp_object, $group ); $cache->save_meta( $wp_object, $name, $values_by_group ); return $values_by_group; } // If $name doesn't matche the group name, returns the field that matches. $groups = $setting->get_groups(); foreach ( $groups as $group ) { $field = $group->get_field( $name ); if ( $field ) { $is_repeatable = $group->is_repeatable(); $value_by_field = self::get_value_by_field( $wp_object, $field, $is_repeatable ); $cache->save_meta( $wp_object, $name, $value_by_field ); return $value_by_field; } } } } /** * Getting all of any meta data to feel good. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @return mixed */ protected static function get_all_meta( $wp_object ) { $cache = Smart_Custom_Fields_Cache::get_instance(); $settings = self::get_settings( $wp_object ); $post_meta = array(); foreach ( $settings as $setting ) { $groups = $setting->get_groups(); foreach ( $groups as $group ) { $is_repeatable = $group->is_repeatable(); $group_name = $group->get_name(); if ( $is_repeatable && $group_name ) { $values_by_group = self::get_values_by_group( $wp_object, $group ); $cache->save_meta( $wp_object, $group_name, $values_by_group ); $post_meta[ $group_name ] = $values_by_group; } else { $fields = $group->get_fields(); foreach ( $fields as $field ) { $field_name = $field->get( 'name' ); $value_by_field = self::get_value_by_field( $wp_object, $field, $is_repeatable ); $cache->save_meta( $wp_object, $field_name, $value_by_field ); $post_meta[ $field_name ] = $value_by_field; } } } } return $post_meta; } /** * If in preview, return the preview post ID. * * @param int $post_id Post id. * @return int */ protected static function get_real_post_id( $post_id ) { if ( is_preview() ) { $preview_post = wp_get_post_autosave( $post_id ); if ( isset( $preview_post->ID ) ) { $post_id = $preview_post->ID; } } return $post_id; } /** * Getting the meta data of the group. * When group, Note the point that returned data are repetition. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param Smart_Custom_Fields_Group $group Group object. * @return mixed */ protected static function get_values_by_group( $wp_object, $group ) { $is_repeatable = $group->is_repeatable(); $meta = array(); $fields = $group->get_fields(); foreach ( $fields as $field ) { if ( $field->get_attribute( 'allow-multiple-data' ) ) { $meta[0][ $field->get( 'name' ) ] = array(); } else { $meta[0][ $field->get( 'name' ) ] = ''; } } $default_meta = $meta[0]; foreach ( $fields as $field ) { $value_by_field = self::get_value_by_field( $wp_object, $field, $is_repeatable ); foreach ( $value_by_field as $i => $value ) { $meta[ $i ][ $field->get( 'name' ) ] = $value; } } foreach ( $meta as $i => $value ) { $meta[ $i ] = array_merge( $default_meta, $value ); } return $meta; } /** * Getting the meta data of the field. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param Smart_Custom_Fields_Field_Base $field Field object. * @param bool $is_repeatable Whether the group that this field belongs is repetition. * @return mixed $post_meta */ protected static function get_value_by_field( $wp_object, $field, $is_repeatable ) { $field_name = $field->get( 'name' ); if ( ! $field_name ) { return; } $meta = new Smart_Custom_Fields_Meta( $wp_object ); // In the case of multi-value items in the loop $field_type = $field->get_attribute( 'type' ); $repeat_multiple_data = self::get_repeat_multiple_data( $wp_object ); if ( is_array( $repeat_multiple_data ) && isset( $repeat_multiple_data[ $field_name ] ) ) { if ( $meta->is_saved_the_key( $field_name ) ) { $_meta = $meta->get( $field_name ); } else { $_meta = self::get_default_value( $field ); } $start = 0; $meta_value = array(); foreach ( $repeat_multiple_data[ $field_name ] as $repeat_multiple_key => $repeat_multiple_value ) { if ( 0 === $repeat_multiple_value ) { $value = array(); } else { $value = array_slice( $_meta, $start, $repeat_multiple_value ); $start += $repeat_multiple_value; } $value = apply_filters( SCF_Config::PREFIX . 'validate-get-value', $value, $field_type ); $meta_value[ $repeat_multiple_key ] = $value; } } else { // Other than that $single = true; if ( $field->get_attribute( 'allow-multiple-data' ) || $is_repeatable ) { $single = false; } if ( $meta->is_saved_the_key( $field_name ) ) { $meta_value = $meta->get( $field_name, $single ); } else { $meta_value = self::get_default_value( $field, $single ); } $meta_value = apply_filters( SCF_Config::PREFIX . 'validate-get-value', $meta_value, $field_type ); } return $meta_value; } /** * Return the default value. * * @param Smart_Custom_Fields_Field_Base $field Field object. * @param bool $single Whether to return a single value. This parameter has no effect if $key is not specified. * @return array|strings */ public static function get_default_value( $field, $single = false ) { if ( ! is_a( $field, 'Smart_Custom_Fields_Field_Base' ) ) { if ( $single ) { return ''; } return array(); } $choices = $field->get( 'choices' ); $default = $field->get( 'default' ); if ( $field->get_attribute( 'allow-multiple-data' ) ) { $choices = self::choices_eol_to_array( $choices ); $default = self::choices_eol_to_array( $default ); $default_sanitized = array(); if ( self::is_assoc( $choices ) ) { $_choices = array_flip( $choices ); } else { $_choices = $choices; } foreach ( $default as $key => $value ) { if ( in_array( $value, $_choices, true ) ) { if ( preg_match( '/^\d+$/', $value ) ) { $value = (int) $value; } $default_sanitized[ $key ] = $value; } } return $default_sanitized; } if ( $single ) { // Return string return $default; } else { // Return array if ( is_array( $default ) ) { return $default; } if ( '' === $default || false === $default || null === $default ) { return array(); } return (array) $default; } } /** * Getting enabled custom field settings in the post type or the role or the term. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @return array */ public static function get_settings_posts( $wp_object ) { $cache = Smart_Custom_Fields_Cache::get_instance(); $settings_posts = array(); if ( null !== $cache->get_settings_posts( $wp_object ) ) { self::debug_cache_message( 'use settings posts cache.' ); return $cache->get_settings_posts( $wp_object ); } else { self::debug_cache_message( 'dont use settings posts cache...' ); } $meta = new Smart_Custom_Fields_Meta( $wp_object ); $types = $meta->get_types( false ); switch ( $meta->get_meta_type() ) { case 'post': $key = SCF_Config::PREFIX . 'condition'; break; case 'user': $key = SCF_Config::PREFIX . 'roles'; break; case 'term': $key = SCF_Config::PREFIX . 'taxonomies'; break; case 'option': $key = SCF_Config::PREFIX . 'options-pages'; break; default: $key = ''; } if ( ! empty( $key ) && ( ! empty( $types ) ) ) { $meta_query = array(); foreach ( $types as $type ) { $meta_query[] = array( 'key' => $key, 'value' => sprintf( '"%s"', $type ), 'compare' => 'LIKE', ); } if ( $meta_query ) { $meta_query['relation'] = 'OR'; } $args = array( 'post_type' => SCF_Config::NAME, 'posts_per_page' => -1, 'order' => 'ASC', 'order_by' => 'menu_order', 'meta_query' => $meta_query, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query ); $settings_posts = get_posts( $args ); } $cache = Smart_Custom_Fields_Cache::get_instance(); $cache->save_settings_posts( $wp_object, $settings_posts ); return $settings_posts; } /** * Getting array of the Setting object. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @return array */ public static function get_settings( $wp_object ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $type = $meta->get_type( false ); $types = $meta->get_types( false ); $meta_type = $meta->get_meta_type(); // IF the post that has custom field settings according to post ID, // don't display because the post ID would change in preview. // So if in preview, re-getting post ID from original post (parent of the preview). if ( 'post' === $meta_type && 'revision' === $wp_object->post_type ) { $wp_object = get_post( $wp_object->post_parent ); } $settings = array(); if ( ! empty( $types ) ) { $settings_posts = self::get_settings_posts( $wp_object ); if ( 'post' === $meta_type ) { $settings = self::get_settings_for_post( $wp_object, $settings_posts ); } elseif ( 'user' === $meta_type ) { $settings = self::get_settings_for_profile( $wp_object, $settings_posts ); } elseif ( 'term' === $meta_type ) { $settings = self::get_settings_for_term( $wp_object, $settings_posts ); } elseif ( 'option' === $meta_type ) { $settings = self::get_settings_for_option( $wp_object, $settings_posts ); } } $settings = apply_filters( SCF_Config::PREFIX . 'register-fields', $settings, $type, $id, $meta_type, $types ); if ( ! is_array( $settings ) ) { $settings = array(); } return $settings; } /** * Getting the Setting object for post. * * @param WP_Post $wp_object WP_Post object. * @param array $settings_posts Settings. * @return array */ protected static function get_settings_for_post( $wp_object, $settings_posts ) { $cache = Smart_Custom_Fields_Cache::get_instance(); $settings = array(); foreach ( $settings_posts as $settings_post ) { if ( $cache->get_settings( $settings_post->ID ) !== null ) { self::debug_cache_message( "use settings cache. [id: {$settings_post->ID}]" ); $setting = $cache->get_settings( $settings_post->ID, $wp_object ); if ( $setting ) { $settings[ $settings_post->ID ] = $setting; } continue; } self::debug_cache_message( "dont use settings cache... [SCF ID: {$settings_post->ID}] [post_type: {$wp_object->post_type}] [Post ID: {$wp_object->ID}]" ); $condition_post_ids_raw = get_post_meta( $settings_post->ID, SCF_Config::PREFIX . 'condition-post-ids', true ); if ( $condition_post_ids_raw ) { $condition_post_ids_raw = explode( ',', $condition_post_ids_raw ); foreach ( $condition_post_ids_raw as $condition_post_id ) { $condition_post_id = trim( $condition_post_id ); $setting = self::add_setting( $settings_post->ID, $settings_post->post_title ); if ( (int) $wp_object->ID === (int) $condition_post_id ) { $settings[ $settings_post->ID ] = $setting; } $post = get_post( $condition_post_id ); if ( empty( $post ) ) { $post = self::generate_post_object( $condition_post_id ); } $cache->save_settings( $settings_post->ID, $setting, $post ); } } else { $setting = self::add_setting( $settings_post->ID, $settings_post->post_title ); $settings[ $settings_post->ID ] = $setting; $cache->save_settings( $settings_post->ID, $setting ); } } return $settings; } /** * Getting the Setting object for user. * * @param WP_User|WP_Term|stdClass $wp_object Object meta object. * @param array $settings_posts Settings. * @return array */ protected static function get_settings_for_profile( $wp_object, $settings_posts ) { $cache = Smart_Custom_Fields_Cache::get_instance(); $settings = array(); foreach ( $settings_posts as $settings_post ) { if ( $cache->get_settings( $settings_post->ID ) !== null ) { self::debug_cache_message( "use settings cache. [id: {$settings_post->ID}]" ); $settings[] = $cache->get_settings( $settings_post->ID ); continue; } self::debug_cache_message( "dont use settings cache... [id: {$settings_post->ID}]" ); $setting = self::add_setting( $settings_post->ID, $settings_post->post_title ); $settings[] = $setting; $cache->save_settings( $settings_post->ID, $setting ); } return $settings; } /** * Getting the Setting object for term. * * @param WP_Term $wp_object WP_Term object. * @param array $settings_posts Settings. * @return array */ protected static function get_settings_for_term( $wp_object, $settings_posts ) { return self::get_settings_for_profile( $wp_object, $settings_posts ); } /** * Getting the Setting object for option. * * @param stdClass $wp_object stdClass object. * @param array $settings_posts Settings. * @return array */ protected static function get_settings_for_option( $wp_object, $settings_posts ) { return self::get_settings_for_profile( $wp_object, $settings_posts ); } /** * Getting delimited identification data of the repeated multi-value items. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @return array */ public static function get_repeat_multiple_data( $wp_object ) { $cache = Smart_Custom_Fields_Cache::get_instance(); $repeat_multiple_data = array(); if ( $cache->get_repeat_multiple_data( $wp_object ) ) { return $cache->get_repeat_multiple_data( $wp_object ); } $meta = new Smart_Custom_Fields_Meta( $wp_object ); $_repeat_multiple_data = $meta->get( SCF_Config::PREFIX . 'repeat-multiple-data', true ); if ( ! empty( $_repeat_multiple_data ) ) { $repeat_multiple_data = $_repeat_multiple_data; } $cache->save_repeat_multiple_data( $wp_object, $repeat_multiple_data ); return $repeat_multiple_data; } /** * Return true if null or empty value. * * @param mixed $value Value. * @return bool */ public static function is_empty( &$value ) { if ( isset( $value ) ) { if ( is_null( $value ) || '' === $value ) { return true; } return false; } return true; } /** * Whether the associative array or not. * * @see http://qiita.com/ka215/items/a14e53547e717d2a564f * * @param array $data This argument should be expected an array. * @param boolean $multidimensional True if a multidimensional array is inclusion into associative array, the default value is false. * @return boolean */ public static function is_assoc( $data, $multidimensional = false ) { if ( ! is_array( $data ) || empty( $data ) ) { return false; } $has_array = false; foreach ( $data as $key => $value ) { if ( is_array( $value ) ) { $has_array = true; } if ( ! is_int( $key ) ) { return true; } } return $multidimensional && $has_array ? true : false; } /** * Adding the available form field object. * * @param Smart_Custom_Fields_Field_Base $instance Field object. */ public static function add_form_field_instance( Smart_Custom_Fields_Field_Base $instance ) { $type = $instance->get_attribute( 'type' ); if ( ! empty( $type ) ) { self::$fields[ $type ] = $instance; } } /** * Getting the available form field object. * * @param string $type Type of the form field. * @return Smart_Custom_Fields_Field_Base */ public static function get_form_field_instance( $type ) { if ( ! empty( self::$fields[ $type ] ) ) { return clone self::$fields[ $type ]; } } /** * Getting all available form field object. * * @return array */ public static function get_form_field_instances() { $fields = array(); foreach ( self::$fields as $type => $instance ) { $fields[ $type ] = self::get_form_field_instance( $type ); } return $fields; } /** * Getting custom fields that saved custo field settings page. * Note that not return only one even define multiple fields with the same name of the field name. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param string $field_name Field name. * @return Smart_Custom_Fields_Field_Base|null */ public static function get_field( $wp_object, $field_name ) { if ( '_locale' === $field_name || '_original_post' === $field_name ) { return null; } $settings = self::get_settings( $wp_object ); foreach ( $settings as $setting ) { $fields = $setting->get_fields(); if ( ! empty( $fields[ $field_name ] ) ) { return $fields[ $field_name ]; } } } /** * Convert to array from newline delimiter $choices. * * @param string $choices Choices. * @return array */ public static function choices_eol_to_array( $choices ) { if ( ! is_array( $choices ) ) { if ( '' === $choices || false === $choices || null === $choices ) { return array(); } $_choices = str_replace( array( "\r\n", "\r", "\n" ), "\n", $choices ); $_choices = explode( "\n", $_choices ); $choices = array(); foreach ( $_choices as $_choice ) { $_choice = array_map( 'trim', explode( '=>', $_choice ) ); if ( count( $_choice ) === 2 ) { $choices[ $_choice[0] ] = $_choice[1]; } else { $choices = array_merge( $choices, $_choice ); } } } return $choices; } /** * Return generated Setting object. * * @param string $id Post ID of custom field settings page. * @param string $title Title of custom field settings page. * @return Smart_Custom_Fields_Setting */ public static function add_setting( $id, $title ) { return new Smart_Custom_Fields_Setting( $id, $title ); } /** * Adding custom options page. * * @see https://developer.wordpress.org/reference/functions/add_menu_page/ * * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. * @param string $menu_title The text to be used for the menu. * @param string $capability The capability required for this menu to be displayed to the user. * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu page and only include lowercase alphanumeric, dashes, and underscores characters to be compatible with sanitize_key(). * @param string $icon_url The URL to the icon to be used for this menu. * @param int $position The position in the menu order this item should appear. * @return string */ public static function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $icon_url = '', $position = null ) { self::$options_pages[ $menu_slug ] = $menu_title; new Smart_Custom_Fields_Options_Page( $page_title, $menu_title, $capability, $menu_slug, $icon_url, $position ); return $menu_slug; } /** * Return array of custom options pages * * @return array */ public static function get_options_pages() { return self::$options_pages; } /** * Generate WP_Post object. * * @param int $post_id Post id. * @param string $post_type Post type. * @return WP_Post */ public static function generate_post_object( $post_id, $post_type = null ) { $post = new stdClass(); $post->ID = $post_id; $post->post_type = $post_type; return new WP_Post( $post ); } /** * Generate option object. * * @param string $menu_slug Menu slug. * @return stdClass */ public static function generate_option_object( $menu_slug ) { $options_pages = self::get_options_pages(); if ( ! isset( $options_pages[ $menu_slug ] ) ) { return; } $option = new stdClass(); $option->menu_slug = $menu_slug; $option->menu_title = $options_pages[ $menu_slug ]; return $option; } /** * Print cache usage. * * @param string $message Message. */ protected static function debug_cache_message( $message ) { if ( defined( 'SCF_DEBUG_CACHE' ) && SCF_DEBUG_CACHE === true ) { echo wp_kses_post( $message ) . '
    '; } } } classes/models/class.group.php000064400000006450146726725200012455 0ustar00name = $group_name; $this->repeat = true === $repeat ? true : false; $fields = array(); foreach ( $_fields as $field_attributes ) { $field = SCF::get_form_field_instance( $field_attributes['type'] ); if ( ! is_a( $field, 'Smart_Custom_Fields_Field_Base' ) ) { continue; } foreach ( $field_attributes as $key => $value ) { $field->set( $key, $value ); } if ( ! empty( $field ) ) { $fields[ $field->get( 'name' ) ] = $field; } } $this->fields = $fields; } /** * Getting group name * * @return string */ public function get_name() { if ( is_numeric( $this->name ) ) { return; } return $this->name; } /** * Getting fields that saved in this settings page * * @return array */ public function get_fields() { return $this->fields; } /** * Getting the field. * * @param string $field_name Field name. * @return Smart_Custom_Fields_Field_Base|null */ public function get_field( $field_name ) { $fields = $this->get_fields(); if ( isset( $fields[ $field_name ] ) ) { return $fields[ $field_name ]; } } /** * Whether repeating group. * * @return bool */ public function is_repeatable() { return $this->repeat; } /** * Displaying "hide" if $repeatable is empty. * * @param string $repeatable Repeatable. */ private function add_hide_class( $repeatable ) { if ( ! $repeatable ) { echo 'hide'; } } /** * Displaying the option fields in custom field settings page ( Common ). * * @param int $group_key Group key. */ public function display_options( $group_key ) { ?>
    *
    restore( $revision ); } /** * リビジョンデータを保存 * *_post_meta はリビジョンIDのときに自動的に本物IDに変換して処理してしまうので、*_metadata を使うこと * * @param int $post_id The revision post id. */ public function wp_insert_post( $post_id ) { if ( ! isset( $_POST[ SCF_Config::NAME ] ) ) { return; } if ( ! wp_is_post_revision( $post_id ) ) { return; } $settings = SCF::get_settings( get_post( $post_id ) ); if ( ! $settings ) { return; } check_admin_referer( SCF_Config::NAME . '-fields', SCF_Config::PREFIX . 'fields-nonce' ); $meta = new Smart_Custom_Fields_Meta( get_post( $post_id ) ); $meta->save( $_POST ); } /** * プレビューのときはプレビューのメタデータを返す。ただし、アイキャッチはリビジョンが無いので除外する * * @param mixed $value The value to return, either a single metadata value or an array of values depending on the value of $single. Default null. * @param int $post_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Whether to return only the first value of the specified $meta_key. * @return mixed */ public function get_post_metadata( $value, $post_id, $meta_key, $single ) { if ( ! is_preview() ) { return $value; } if ( is_null( SCF::get_field( get_post( $post_id ), $meta_key ) ) ) { return $value; } $preview_id = $this->get_preview_id( $post_id ); if ( $preview_id && '_thumbnail_id' !== $meta_key ) { if ( $post_id !== $preview_id ) { $value = get_post_meta( $preview_id, $meta_key, $single ); } } return $value; } /** * プレビューの Post ID を返す * * @param int $post_id The post id. * @return int */ protected function get_preview_id( $post_id ) { global $post; $preview_id = 0; if ( isset( $post->ID ) && intval( $post->ID ) === intval( $post_id ) ) { $preview = wp_get_post_autosave( $post_id ); if ( is_preview() && $preview ) { $preview_id = $preview->ID; } } return $preview_id; } /** * リビジョン比較画面でメタデータを表示させるためにキーを追加する * * @param array $fields List of fields to revision. Contains 'post_title', 'post_content', and 'post_excerpt' by default. * @return array */ public function _wp_post_revision_fields( $fields ) { $fields[ SCF_Config::PREFIX . 'debug-preview' ] = esc_html__( 'Smart Custom Fields', 'smart-custom-fields' ); return $fields; } /** * プレビュー時にメタデータを保存するためにキーとなる項目を出力する */ public function edit_form_after_title() { printf( '', esc_attr( SCF_Config::PREFIX . 'debug-preview' ) ); } /** * Display metadata on revision comparison screen. * * @param string $value The current revision field to compare to or from. * @param string $column The current revision field. * @param WP_Post $post The revision post object to compare to or from. * @return string */ public function _wp_post_revision_field_debug_preview( $value, $column, $post ) { $output = ''; $values = SCF::gets( $post->ID ); foreach ( $values as $field_name_or_group_name => $value ) { $output .= sprintf( "■ %s\n", $field_name_or_group_name ); if ( is_array( $value ) ) { if ( isset( $value[0] ) && is_array( $value[0] ) ) { foreach ( $value as $i => $repeat_data_values ) { $output .= sprintf( "- #%s\n", $i ); foreach ( $repeat_data_values as $field_name => $repeat_data_value ) { $output .= sprintf( ' %s: ', $field_name ); if ( is_array( $repeat_data_value ) ) { $output .= sprintf( "[%s]\n", implode( ', ', $repeat_data_value ) ); } else { $output .= sprintf( "%s\n", $repeat_data_value ); } } } } else { $output .= sprintf( "[%s]\n", implode( ', ', $value ) ); } } else { $output .= sprintf( "%s\n", $value ); } } return $output; } /** * If false, it is saved as a revision. * * @param bool $check_for_changes Whether to check for changes before saving a new revision. Default true. * @param WP_Post $last_revision The last revision post object. * @param WP_Post $post The post object. * @return bool */ public function wp_save_post_revision_check_for_changes( $check_for_changes, $last_revision, $post ) { $post_meta = array(); $p = get_post_custom( $post->ID ); foreach ( $p as $key => $value ) { $v = SCF::get( $key ); if ( ! is_null( $v ) ) { $post_meta[ $key ][] = $v; } } $posted_data = filter_input( INPUT_POST, SCF_Config::NAME, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( $posted_data && maybe_serialize( $post_meta ) !== maybe_serialize( $posted_data ) ) { return false; } return true; } } classes/models/class.options-page.php000064400000005347146726725200013732 0ustar00page_title = $page_title; $this->menu_title = $menu_title; $this->capability = $capability; $this->menu_slug = $menu_slug; $this->icon_url = $icon_url; $this->position = $position; add_action( 'admin_menu', array( $this, 'add_options_page_menu' ) ); } /** * Add options page menu. */ public function add_options_page_menu() { return add_menu_page( $this->page_title, $this->menu_title, $this->capability, $this->menu_slug, array( $this, 'display' ), $this->icon_url, $this->position ); } /** * Display option. */ public function display() { $option = SCF::generate_option_object( filter_input( INPUT_GET, 'page' ) ); if ( ! $option ) { return; } ?>

    menu_title ); ?>

    '', // eg. text 'display-name' => '', // eg. Text 'optgroup' => 'other-fields', 'allow-multiple-data' => false, 'layout' => 'default', // or "full-width" (new attribute to choose layout type) ); /** * Options of this field * * @var array */ protected $options = array( 'name' => '', 'label' => '', ); /** * __construct */ public function __construct() { $attributes = array_merge( $this->attributes, $this->init() ); $options = array_merge( $this->options, $this->options() ); if ( empty( $attributes['type'] ) || empty( $attributes['display-name'] ) ) { exit( 'This field object is invalid. Field object must have type and display-name attributes.' ); } if ( empty( $attributes['optgroup'] ) ) { $attributes['optgroup'] = 'basic-fields'; } $this->attributes = $attributes; $this->options = $options; add_filter( SCF_Config::PREFIX . 'field-select-' . $attributes['optgroup'], array( $this, 'field_select' ) ); $this->after_loaded(); SCF::add_form_field_instance( $this ); } /** * Set the required items * * @return array */ abstract protected function init(); /** * Set the non required items * * @return array */ abstract protected function options(); /** * Processing to be executed immediately after the field initialization */ protected function after_loaded() { } /** * Getting the field. * * @param int $index Field index. * @param mixed $value Field value. * @return string */ abstract public function get_field( $index, $value ); /** * Adding the type of this field to fields selection in custom field settings page. * * @param array $attributes List of fields that belong to the optgroup. * @return array */ public function field_select( $attributes ) { $attributes[ $this->get_attribute( 'type' ) ] = $this->get_attribute( 'display-name' ); return $attributes; } /** * Displaying the option fields in custom field settings page ( Common ). * * @param int $group_key Group key. * @param int $field_key Field key. */ public function display_options( $group_key, $field_key ) { $fields = SCF::get_form_field_instances(); foreach ( $fields as $field ) { if ( $field->get_attribute( 'type' ) === $this->get_attribute( 'type' ) ) { foreach ( $this->options as $key => $value ) { $field->set( $key, $value ); } } $field->_display_field_options( $group_key, $field_key ); } } /** * Displaying the name in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. */ protected function display_name_option( $group_key, $field_key ) { ?> * display_field_options( $group_key, $field_key ); ?>
    get( 'name' ), $index ); } /** * Whether to disabled. * Return true only when the null because data that all users have saved when $index is not null * * @param string $index Field index. * @return bool */ protected function get_disable_attribute( $index ) { $disabled = false; if ( is_null( $index ) ) { $disabled = true; } return $disabled; } /** * Getting the name attribute in custom field settings page. * * @param int $group_key Group key. * @param int $field_key Field key. * @param string $name Field name. * @return string */ public function get_field_name_in_setting( $group_key, $field_key, $name ) { return sprintf( '%s[%s][fields][%s][%s]', SCF_Config::NAME, $group_key, $field_key, $name ); } /** * Getting saved option value. * * @param string $key Key of options of this field. * @return mixed */ public function get( $key ) { if ( array_key_exists( $key, $this->options ) ) { return $this->options[ $key ]; } } /** * Set option value. * * @param string $key Key of options of this field. * @param mixed $value Value of options of this field. */ public function set( $key, $value ) { if ( array_key_exists( $key, $this->options ) ) { $this->options[ $key ] = $value; } } /** * Getting the attribute value. * * @param string $key Internal attribute key. * @return mixed */ public function get_attribute( $key ) { if ( array_key_exists( $key, $this->attributes ) ) { return $this->attributes[ $key ]; } } } classes/models/class.ajax.php000064400000001520146726725200012235 0ustar00delete_term_meta_for_wp43(); } } classes/models/class.setting.php000064400000006474146726725200013004 0ustar00id = $id; $this->title = $title; $post_meta = get_post_meta( $this->get_id(), SCF_Config::PREFIX . 'setting', true ); if ( is_array( $post_meta ) ) { foreach ( $post_meta as $group ) { $group = shortcode_atts( array( 'group-name' => '', 'repeat' => false, 'fields' => array(), ), $group ); $this->add_group( $group['group-name'], $group['repeat'], $group['fields'] ); } } } /** * Getting the post ID. * * @return string */ public function get_id() { return $this->id; } /** * Getting the post title. * * @return string */ public function get_title() { return $this->title; } /** * Getting the group objects. * * @return array */ public function get_groups() { return $this->groups; } /** * Getting together the fields in each group. * * @return array */ public function get_fields() { $groups = $this->get_groups(); $fields = array(); foreach ( $groups as $group ) { $fields = array_merge( $fields, $group->get_fields() ); } return $fields; } /** * Adding group to the tail. * If the argument is not, adding an empty group. * * @param string $group_name Gruop name. * @param bool $repeat If repeat, set true. * @param array $fields Fields. */ public function add_group( $group_name = null, $repeat = false, array $fields = array() ) { $group = $this->new_group( $group_name, $repeat, $fields ); $group_name = $group->get_name(); if ( $group_name ) { $this->groups[ $group_name ] = $group; } else { $this->groups[] = $group; } } /** * Getting group. * * @param string $group_name Gruop name. * @return Smart_Custom_Fields_Group|false */ public function get_group( $group_name ) { $groups = $this->get_groups(); if ( isset( $groups[ $group_name ] ) && $groups[ $group_name ]->is_repeatable() ) { return $groups[ $group_name ]; } } /** * Adding group to the head. * If the argument is not, adding an empty group. * * @param string $group_name Gruop name. * @param bool $repeat If repeat, set true. * @param array $fields Fields. */ public function add_group_unshift( $group_name = null, $repeat = false, array $fields = array() ) { $group = $this->new_group( $group_name, $repeat, $fields ); array_unshift( $this->groups, $group ); } /** * Getting generated new group. * * @param string $group_name Gruop name. * @param bool $repeat If repeat, set true. * @param array $fields Fields. */ protected function new_group( $group_name, $repeat, $fields ) { return new Smart_Custom_Fields_Group( $group_name, $repeat, $fields ); } } classes/models/class.meta.php000064400000035756146726725200012262 0ustar00object = $wp_object; if ( is_a( $wp_object, 'WP_Post' ) ) { $this->id = $wp_object->ID; $this->type = $wp_object->post_type; $this->types = array( $wp_object->post_type ); $this->meta_type = 'post'; } elseif ( is_a( $wp_object, 'WP_User' ) ) { $this->id = $wp_object->ID; $this->type = $wp_object->roles[0]; $this->types = array_unique( array_merge( $wp_object->roles, array_keys( $wp_object->caps ) ) ); $this->meta_type = 'user'; } elseif ( isset( $wp_object->term_id ) ) { $this->id = $wp_object->term_id; $this->type = $wp_object->taxonomy; $this->types = array( $wp_object->taxonomy ); $this->meta_type = 'term'; } elseif ( isset( $wp_object->menu_slug ) ) { $this->id = $wp_object->menu_slug; $this->type = $wp_object->menu_slug; $this->types = array( $wp_object->menu_slug ); $this->meta_type = 'option'; } elseif ( empty( $wp_object ) || is_wp_error( $wp_object ) ) { $this->id = null; $this->type = null; $this->types = null; $this->meta_type = null; } else { throw new Exception( sprintf( 'Invalid $wp_object type error. $wp_object is "%s".', esc_html( get_class( $wp_object ) ) ) ); } } /** * Getting the meta type * * @return string post or user or term or option */ public function get_meta_type() { return $this->meta_type; } /** * Getting object ID. When option, this is menu slug. * * @return int|string */ public function get_id() { return $this->id; } /** * Getting type ( Post type or Role or Taxonomy or Menu slug ). * * @deprecated * * @param bool $accept_revision If post type, whether allow revision post type. * @return string */ public function get_type( $accept_revision = true ) { if ( 'post' === $this->meta_type && ! $accept_revision ) { $public_post_type = $this->get_public_post_type( $this->id ); return $public_post_type[0]; } return $this->type; } /** * Getting type ( Post type or Role or Taxonomy or Menu slug ). * * @param bool $accept_revision If post type, whether allow revision post type. * @return array */ public function get_types( $accept_revision = true ) { if ( 'post' === $this->meta_type && ! $accept_revision ) { return $this->get_public_post_type( $this->id ); } return $this->types; } /** * Getting post type. * To feel good also Post ID of the revision. * * @param int $post_id Post id. * @return array */ protected function get_public_post_type( $post_id ) { $public_post_id = wp_is_post_revision( $post_id ); if ( $public_post_id ) { $post = get_post( $public_post_id ); } else { $post = get_post( $post_id ); } if ( ! empty( $post->post_type ) ) { return array( $post->post_type ); } return $this->types; } /** * Object with this meta data is whether saved. * Post ... If auto-draft, not saved (new posts in) * Profile or Taxonomy or option ... Since not display only after saving. * So if all of meta data is empty, * It is determined that not saved * * @return bool */ public function is_saved() { if ( 'post' === $this->meta_type && 'auto-draft' === get_post_status( $this->get_id() ) ) { return false; } if ( ! $this->get() ) { return false; } return true; } /** * The metadata is wheter saved. * * @param string $key Meta key. * @return bool */ public function is_saved_the_key( $key ) { if ( 'post' === $this->meta_type && 'auto-draft' === get_post_status( $this->get_id() ) ) { return false; } if ( _get_meta_table( $this->meta_type ) && ! $this->maybe_4_3_term_meta() ) { return metadata_exists( $this->meta_type, $this->id, $key ); } $option = get_option( $this->get_option_name() ); if ( is_array( $option ) ) { return array_key_exists( $key, $option ); } return false; } /** * Less than WordPress 4.4 compatibility for term meta. * More than 4.4 are saved in meta. So if that use the meta data. * * @return bool */ public function maybe_4_3_term_meta() { if ( 'term' === $this->meta_type ) { if ( ! get_metadata( $this->meta_type, $this->id ) && get_option( $this->get_option_name() ) ) { return true; } } return false; } /** * Getting the meta data. * * @param string|null $key Field key. * @param bool $single false ... return array, true ... return string. * @return string|array */ public function get( $key = '', $single = false ) { if ( _get_meta_table( $this->meta_type ) && ! $this->maybe_4_3_term_meta() ) { $meta = get_metadata( $this->meta_type, $this->id, $key, $single ); } else { $meta = $this->get_option_metadata( $key, $single ); } if ( SCF_Config::PREFIX . 'repeat-multiple-data' === $key ) { return $meta; } $settings = SCF::get_settings( $this->object ); if ( $key ) { foreach ( $settings as $setting ) { $fields = $setting->get_fields(); if ( ! empty( $fields[ $key ] ) ) { return $meta; } } } elseif ( is_array( $meta ) ) { $metas = array(); foreach ( $settings as $setting ) { $fields = $setting->get_fields(); foreach ( $meta as $meta_key => $meta_value ) { if ( isset( $fields[ $meta_key ] ) ) { $metas[ $meta_key ] = $meta[ $meta_key ]; } } } } if ( ! empty( $metas ) ) { return $metas; } if ( $single ) { return ''; } return array(); } /** * Getting option like meta data. * * @param string|null $key Option key. * @param bool $single false ... return array, true ... return string. * @return string|array */ protected function get_option_metadata( $key, $single ) { $option = get_option( $this->get_option_name() ); if ( ! $key ) { return $option; } if ( isset( $option[ $key ] ) ) { if ( $single && is_array( $option[ $key ] ) ) { if ( isset( $option[ $key ][0] ) ) { return $option[ $key ][0]; } } else { return $option[ $key ]; } } if ( $single ) { return ''; } return array(); } /** * Updating meta data. If the meta data not exist, adding it. * * @param string $key Option key. * @param mixed $value Option value. * @param mixed $prev_value If specified, it overwrites the only ones of this value. * @return int|false */ public function update( $key, $value, $prev_value = '' ) { $return = false; do_action( SCF_Config::PREFIX . '-before-save-' . $this->meta_type, $this->id, $key, $value ); $is_valid = apply_filters( SCF_Config::PREFIX . '-validate-save-' . $this->meta_type, $this->id, $key, $value ); if ( $is_valid ) { if ( _get_meta_table( $this->meta_type ) ) { $return = update_metadata( $this->meta_type, $this->id, $key, $value, $prev_value ); } else { $return = $this->update_option_metadata( $key, $value, $prev_value ); } } do_action( SCF_Config::PREFIX . '-after-save-' . $this->meta_type, $this->id, $key, $value ); return $return; } /** * Updating the option like meta data. If the meta data not exist, adding it. * * @param string $key Option key. * @param mixed $value Option value. * @param mixed $prev_value If specified, it overwrites the only ones of this value. * @return bool */ protected function update_option_metadata( $key, $value, $prev_value ) { $option_name = $this->get_option_name(); $option = get_option( $option_name ); if ( isset( $option[ $key ] ) ) { if ( '' !== $prev_value ) { foreach ( $option[ $key ] as $option_key => $option_value ) { if ( $prev_value === $option_value ) { $option[ $key ][ $option_key ] = $value; break; } } } else { foreach ( $option[ $key ] as $option_key => $option_value ) { $option[ $key ][ $option_key ] = $value; } } } else { $option[ $key ][] = $value; } $option = stripslashes_deep( $option ); return update_option( $option_name, $option, false ); } /** * Adding the meta data. * * @param string $key Option key. * @param mixed $value Option value. * @param bool $unique Whether the key to the unique. * @return int|false */ public function add( $key, $value, $unique = false ) { $return = false; do_action( SCF_Config::PREFIX . '-before-save-' . $this->meta_type, $this->id, $key, $value ); $is_valid = apply_filters( SCF_Config::PREFIX . '-validate-save-' . $this->meta_type, $this->id, $key, $value ); if ( $is_valid ) { if ( _get_meta_table( $this->meta_type ) ) { $return = add_metadata( $this->meta_type, $this->id, $key, $value, $unique ); } else { $return = $this->add_option_metadata( $key, $value, $unique ); } } do_action( SCF_Config::PREFIX . '-after-save-' . $this->meta_type, $this->id, $key, $value ); return $return; } /** * Adding the option like meta data. * * @param string $key Option key. * @param mixed $value Option value. * @param bool $unique Whether the key to the unique. * @return bool */ protected function add_option_metadata( $key, $value, $unique ) { $option_name = $this->get_option_name(); $option = get_option( $option_name ); if ( ! $unique || ! isset( $option[ $key ] ) ) { $option[ $key ][] = $value; $option = stripslashes_deep( $option ); return update_option( $option_name, $option, false ); } return false; } /** * Deleting the meta data. * * @param string $key Meta key. * @param mixed $value If specified, it deletes the only ones of this value. * @return bool */ public function delete( $key = '', $value = '' ) { if ( _get_meta_table( $this->meta_type ) ) { if ( $key ) { return delete_metadata( $this->meta_type, $this->id, $key, $value ); } } elseif ( $key ) { return $this->delete_option_metadata( $key, $value ); } return false; } /** * Deleting the option like meta data. * * @param string $key Option key. * @param mixed $value If specified, it deletes the only ones of this value. * @return bool */ protected function delete_option_metadata( $key, $value ) { $option_name = $this->get_option_name(); $option = get_option( $option_name ); if ( isset( $option[ $key ] ) && '' === $value ) { unset( $option[ $key ] ); return update_option( $option_name, $option ); } if ( isset( $option[ $key ] ) && '' !== $value ) { foreach ( $option[ $key ] as $option_key => $option_value ) { if ( $option_value === $value ) { unset( $option[ $key ][ $option_key ] ); } } return update_option( $option_name, $option ); } return false; } /** * Delete all term meta for less than WordPress 4.3. */ public function delete_term_meta_for_wp43() { $option_name = $this->get_option_name(); return delete_option( $option_name ); } /** * Saving the meta data based on the posted data. * * @param array $__post $_POST. */ public function save( array $__post ) { // For repeated multi-value items identification $repeat_multiple_data = array(); // Retruning empty value when multi-value is empty, it doesn't save $multiple_data_fields = array(); if ( is_null( $this->object ) ) { return; } $this->delete( SCF_Config::PREFIX . 'repeat-multiple-data' ); if ( ! isset( $__post[ SCF_Config::NAME ] ) ) { return; } $settings = SCF::get_settings( $this->object ); $saved_data = array(); foreach ( $settings as $setting ) { $groups = $setting->get_groups(); foreach ( $groups as $group ) { $fields = $group->get_fields(); foreach ( $fields as $field ) { $field_name = $field->get( 'name' ); if ( ! isset( $__post[ SCF_Config::NAME ][ $field_name ] ) ) { continue; } $saved_data[ $field_name ] = $__post[ SCF_Config::NAME ][ $field_name ]; $this->delete( $field_name ); if ( $field->get_attribute( 'allow-multiple-data' ) ) { $multiple_data_fields[] = $field_name; } if ( $group->is_repeatable() && $field->get_attribute( 'allow-multiple-data' ) ) { $repeat_multiple_data_fields = $saved_data[ $field_name ]; foreach ( $repeat_multiple_data_fields as $values ) { if ( is_array( $values ) ) { $repeat_multiple_data[ $field_name ][] = count( $values ); } else { $repeat_multiple_data[ $field_name ][] = 0; } } } } } } if ( $repeat_multiple_data ) { $this->update( SCF_Config::PREFIX . 'repeat-multiple-data', $repeat_multiple_data ); } foreach ( $saved_data as $name => $values ) { foreach ( $values as $value ) { if ( in_array( $name, $multiple_data_fields, true ) && '' === $value ) { continue; } if ( ! is_array( $value ) ) { $this->add( $name, $value ); } else { foreach ( $value as $val ) { $this->add( $name, $val ); } } } } } /** * Restore the data from the revision. * * @param WP_Post $revision The revision post. */ public function restore( $revision ) { if ( 'post' !== $this->meta_type || is_null( $this->object ) || ! is_a( $revision, 'WP_Post' ) ) { return; } $settings = SCF::get_settings( $this->object ); foreach ( $settings as $setting ) { $fields = $setting->get_fields(); foreach ( $fields as $field ) { $field_name = $field->get( 'name' ); $this->delete( $field_name ); $value = SCF::get( $field_name, $revision->ID ); if ( is_array( $value ) ) { foreach ( $value as $val ) { if ( is_array( $val ) ) { foreach ( $val as $v ) { // Repeated multi-value items $this->add( $field_name, $v ); } } else { // Repeated single-value items or Non repeated multi-value items $this->add( $field_name, $val ); } } } else { // Non repeated single-value item $this->add( $field_name, $value ); } } } $repeat_multiple_data = SCF::get_repeat_multiple_data( $revision ); $repeat_multiple_data_name = SCF_Config::PREFIX . 'repeat-multiple-data'; $this->delete( $repeat_multiple_data_name ); $this->update( $repeat_multiple_data_name, $repeat_multiple_data ); } /** * Getting option name for saved options table. * * @return string */ public function get_option_name() { return sprintf( '%s%s-%s-%d', SCF_Config::PREFIX, $this->meta_type, $this->type, $this->id ); } } classes/models/class.cache.php000064400000017170146726725200012365 0ustar00clear_meta(); $this->clear_settings_posts(); $this->clear_settings(); $this->clear_repeat_multiple_data(); } /** * Saving to cache. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @param string $name Cache name. * @param mixed $data Cache data. */ public function save_meta( $wp_object, $name, $data ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $type = $meta->get_type(); $meta_type = $meta->get_meta_type(); if ( ! empty( $id ) && ! empty( $type ) && ! empty( $meta_type ) ) { $this->meta[ $meta_type . '_' . $type . '_' . $id ][ $name ] = $data; } } /** * Getting the cache. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @param string $name Cache name. * @return mixed */ public function get_meta( $wp_object, $name = null ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $type = $meta->get_type(); $meta_type = $meta->get_meta_type(); if ( ! empty( $id ) && ! empty( $type ) && ! empty( $meta_type ) ) { if ( is_null( $name ) ) { if ( isset( $this->meta[ $meta_type . '_' . $type . '_' . $id ] ) ) { return $this->meta[ $meta_type . '_' . $type . '_' . $id ]; } } elseif ( isset( $this->meta[ $meta_type . '_' . $type . '_' . $id ][ $name ] ) ) { return $this->meta[ $meta_type . '_' . $type . '_' . $id ][ $name ]; } } } /** * Clear caches. */ public function clear_meta() { $this->meta = array(); } /** * Saving to cache that enabled custom field settings in the post type or the role or the term. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @param array $settings_posts Settings. */ public function save_settings_posts( $wp_object, $settings_posts ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $type = $meta->get_type( false ); $meta_type = $meta->get_meta_type(); $this->settings_posts[ $meta_type . '_' . $type ] = $settings_posts; } /** * Getting cache that enabled custom field settings in the post type or the role or the term. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @return array|null */ public function get_settings_posts( $wp_object ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $type = $meta->get_type( false ); $meta_type = $meta->get_meta_type(); if ( isset( $this->settings_posts[ $meta_type . '_' . $type ] ) ) { return $this->settings_posts[ $meta_type . '_' . $type ]; } } /** * Clear the $settings_posts. */ public function clear_settings_posts() { $this->settings_posts = array(); } /** * Saving the Setting object to cache. * * @param int $settings_post_id Settings id. * @param Smart_Custom_Fields_Setting $setting Smart_Custom_Fields_Setting object. * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. */ public function save_settings( $settings_post_id, $setting, $wp_object = null ) { if ( ! is_null( $wp_object ) ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $meta_type = $meta->get_meta_type(); } if ( ! empty( $meta_type ) && ! empty( $id ) ) { $this->settings[ $settings_post_id ][ $meta_type . '_' . $id ] = $setting; } else { $this->settings[ $settings_post_id ][0] = $setting; } } /** * Getting the Setting object cache * If there isn't the custom field settings ... null * If there is custom field settings * If there is no data for the specified $meta_type + $id * There is a thing of the General ... Smart_Custom_Fields_Setting * There isn't a thing of the General ... false * If there the data for the specified $meta_type + $id ... Smart_Custom_Fields_Setting * * @param int $settings_post_id Settings id. * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @return Smart_Custom_Fields_Setting|false|null */ public function get_settings( $settings_post_id, $wp_object = null ) { if ( ! is_null( $wp_object ) ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $meta_type = $meta->get_meta_type(); } if ( isset( $this->settings[ $settings_post_id ] ) ) { $settings = $this->settings[ $settings_post_id ]; if ( ! empty( $id ) && ! empty( $meta_type ) && isset( $settings[ $meta_type . '_' . $id ] ) ) { return $settings[ $meta_type . '_' . $id ]; } if ( isset( $settings[0] ) ) { return $settings[0]; } return false; } } /** * Clear the $settings */ public function clear_settings() { $this->settings = array(); } /** * Saving the delimited identification data of the repeated multi-value items to cache. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @param mixed $repeat_multiple_data Repeat multiple data. */ public function save_repeat_multiple_data( $wp_object, $repeat_multiple_data ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $type = $meta->get_type(); $meta_type = $meta->get_meta_type(); if ( ! empty( $id ) && ! empty( $type ) && ! empty( $meta_type ) ) { $this->repeat_multiple_data[ $meta_type . '_' . $type . '_' . $id ] = $repeat_multiple_data; } } /** * Getting delimited identification data of the repeated multi-value items from cache. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object type object. * @return mixed */ public function get_repeat_multiple_data( $wp_object ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $id = $meta->get_id(); $type = $meta->get_type(); $meta_type = $meta->get_meta_type(); if ( ! empty( $id ) && ! empty( $type ) ) { if ( isset( $this->repeat_multiple_data[ $meta_type . '_' . $type . '_' . $id ] ) ) { return $this->repeat_multiple_data[ $meta_type . '_' . $type . '_' . $id ]; } } } /** * Clear delimited identification data of the repeated multi-value items cache. */ public function clear_repeat_multiple_data() { $this->repeat_multiple_data = array(); } } classes/class.config.php000064400000000610146726725200011273 0ustar00 esc_html__( 'Image setting', 'smart-custom-fields' ), 'file_uploader_title' => esc_html__( 'File setting', 'smart-custom-fields' ), ) ); do_action( SCF_Config::PREFIX . 'after-editor-enqueue-scripts', $hook ); if ( ! user_can_richedit() ) { wp_enqueue_script( 'tinymce', SMART_CUSTOM_FIELDS_URL . '/js/tinymce/tinymce.min.js', array(), filemtime( SMART_CUSTOM_FIELDS_PATH . '/js/tinymce/tinymce.min.js' ), true ); } } /** * Display custom fields in edit page. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param array $callback_args Custom field setting information. */ public function display_meta_box( $wp_object, $callback_args ) { $groups = $callback_args['args']; $tables = $this->get_tables( $wp_object, $groups ); printf( '
    ', esc_attr( SCF_Config::PREFIX . 'meta-box' ) ); $index = 0; foreach ( $tables as $group_key => $group ) { $is_repeatable = $group->is_repeatable(); if ( $is_repeatable && 0 === $index ) { printf( '
    ', esc_attr( SCF_Config::PREFIX . 'meta-box-repeat-tables' ) ); $this->display_tr( $wp_object, $is_repeatable, $group->get_fields() ); } $this->display_tr( $wp_object, $is_repeatable, $group->get_fields(), $index ); // If in the loop, count up the index. // If exit the loop, reset the count. if ( $is_repeatable && isset( $tables[ $group_key + 1 ] ) && $group->get_name() === $tables[ $group_key + 1 ]->get_name() ) { ++$index; } else { $index = 0; } if ( $is_repeatable && 0 === $index ) { printf( '
    ' ); } } printf( '
    ' ); wp_nonce_field( SCF_Config::NAME . '-fields', SCF_Config::PREFIX . 'fields-nonce' ); } /** * Saving posted data. * * @param array $data Data. * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. */ protected function save( $data, $wp_object ) { check_admin_referer( SCF_Config::NAME . '-fields', SCF_Config::PREFIX . 'fields-nonce' ); $meta = new Smart_Custom_Fields_Meta( $wp_object ); $meta->save( $data ); } /** * Generating array for displaying the custom fields. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param array $groups Settings from custom field settings page. * @return array Array for displaying a table for custom fields. */ protected function get_tables( $wp_object, $groups ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $repeat_multiple_data = SCF::get_repeat_multiple_data( $wp_object ); $tables = array(); foreach ( $groups as $group ) { // If in the loop, Added groupgs by the amount of the loop. // Added only one if setting is repetition but not loop (Ex, new registration) if ( true === $group->is_repeatable() ) { $loop_count = 1; $fields = $group->get_fields(); foreach ( $fields as $field ) { $field_name = $field->get( 'name' ); $meta_value = $meta->get( $field_name ); if ( is_array( $meta_value ) ) { $meta_count = count( $meta_value ); // When the same name of the custom field is a multiple (checbox or loop) if ( $meta_count > 1 ) { // checkbox if ( $field->get_attribute( 'allow-multiple-data' ) ) { if ( is_array( $repeat_multiple_data ) && isset( $repeat_multiple_data[ $field_name ] ) ) { $repeat_multiple_data_count = count( $repeat_multiple_data[ $field_name ] ); if ( $loop_count < $repeat_multiple_data_count ) { $loop_count = $repeat_multiple_data_count; } } } elseif ( $loop_count < $meta_count ) { // other than checkbox $loop_count = $meta_count; } } } } if ( $loop_count >= 1 ) { for ( $i = $loop_count; $i > 0; $i-- ) { $tables[] = $group; } continue; } } $tables[] = $group; } return $tables; } /** * Getting the multi-value field meta data. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param Smart_Custom_Fields_Field_Base $field Field object. * @param int $index Index of value. * @return array */ public function get_multiple_data_field_value( $wp_object, $field, $index ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $field_name = $field->get( 'name' ); if ( is_null( $index ) ) { return SCF::get_default_value( $field ); } if ( ! $meta->is_saved_the_key( $field_name ) ) { return SCF::get_default_value( $field ); } $value = $meta->get( $field_name ); // in the loop $repeat_multiple_data = SCF::get_repeat_multiple_data( $wp_object ); if ( is_array( $repeat_multiple_data ) && isset( $repeat_multiple_data[ $field_name ] ) ) { $now_num = 0; if ( is_array( $repeat_multiple_data[ $field_name ] ) && isset( $repeat_multiple_data[ $field_name ][ $index ] ) ) { $now_num = $repeat_multiple_data[ $field_name ][ $index ]; } // The index is starting point to refer to the total of the previous number than me ($index) $_temp = array_slice( $repeat_multiple_data[ $field_name ], 0, $index ); $sum = array_sum( $_temp ); $start = $sum; if ( $now_num ) { $value = array_slice( $value, $start, $now_num ); } else { $value = array(); } } return $value; } /** * Getting the non multi-value field meta data. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param Smart_Custom_Fields_Field_Base $field Field object. * @param int $index Index of value. * @return string */ public function get_single_data_field_value( $wp_object, $field, $index ) { $meta = new Smart_Custom_Fields_Meta( $wp_object ); $field_name = $field->get( 'name' ); if ( is_null( $index ) ) { return SCF::get_default_value( $field, true ); } if ( $meta->is_saved_the_key( $field_name ) ) { $value = $meta->get( $field_name ); if ( isset( $value[ $index ] ) ) { return $value[ $index ]; } return ''; } return SCF::get_default_value( $field, true ); } /** * Displaying tr element for table of custom fields. * * @param WP_Post|WP_User|WP_Term|stdClass $wp_object Object meta object. * @param bool $is_repeat If repeat, return true. * @param array $fields Fields. * @param int|null $index Field index. */ protected function display_tr( $wp_object, $is_repeat, $fields, $index = null ) { $btn_repeat = ''; if ( $is_repeat ) { $btn_repeat = sprintf( '', esc_attr( SCF_Config::PREFIX . 'icon-handle dashicons dashicons-menu' ) ); $btn_repeat .= ''; $btn_repeat .= ' '; } printf( '
    %s', esc_attr( SCF_Config::PREFIX . 'meta-box-table' ), is_null( $index ) ? 'style="display: none;"' : '', $btn_repeat // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); foreach ( $fields as $field ) { $field_type = $field->get_attribute( 'type' ); // gets the field type for use in aditional CSS classes $layout = $field->get_attribute( 'layout' ); // get layout type $field_name = $field->get( 'name' ); $field_label = $field->get( 'label' ); if ( ! $field_label ) { $field_label = $field_name; } if ( $field->get_attribute( 'allow-multiple-data' ) ) { // When multi-value field $value = $this->get_multiple_data_field_value( $wp_object, $field, $index ); } else { // When non multi-value field $value = $this->get_single_data_field_value( $wp_object, $field, $index ); } $instruction = $field->get( 'instruction' ); if ( ! empty( $instruction ) ) { if ( apply_filters( SCF_Config::PREFIX . 'instruction-apply-html', false ) === true ) { $instruction_html = $instruction; } else { $instruction_html = esc_html( $instruction ); } $instruction = sprintf( '
    %s
    ', $instruction_html ); } printf( ' %2$s
    %3$s %4$s %5$s
    ', esc_attr( SCF_Config::PREFIX ), 'full-width' !== $layout ? '' . esc_html( $field_label ) . '' : '', $instruction, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $field->get_field( $index, $value ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $field->get( 'notes' ) ? '

    ' . esc_html( $field->get( 'notes' ) ) . '

    ' : '', esc_attr( $field_type ), esc_attr( $layout ) ); } echo '
    '; } } classes/controller/class.taxonomy.php000064400000005042146726725200014073 0ustar00get_groups(); ?>
    get_title() ); ?> display_meta_box( $term, $callback_args ); ?>
    save( filter_input_array( INPUT_POST ), $term ); } /** * Delete meta data. * * @param int $term_id Term ID. * @param int $term_taxonomy_id Term taxonomy ID. * @param string $taxonomy Taxonomy slug. * @param object $deleted_term Copy of the already-deleted term. */ public function delete( $term_id, $term_taxonomy_id, $taxonomy, $deleted_term ) { $meta = new Smart_Custom_Fields_Meta( $deleted_term ); $meta->delete(); } } classes/controller/class.option.php000064400000004061146726725200013525 0ustar00
    get_groups(); ?>
    get_title() ); ?> display_meta_box( $option, $callback_args ); ?>

    save( filter_input_array( INPUT_POST ), $option ); } } classes/controller/class.settings.php000064400000044063146726725200014063 0ustar00optgroups = array( 'basic-fields' => array( 'label' => esc_attr__( 'Basic fields', 'smart-custom-fields' ), 'options' => array(), ), 'select-fields' => array( 'label' => esc_attr__( 'Select fields', 'smart-custom-fields' ), 'options' => array(), ), 'content-fields' => array( 'label' => esc_attr__( 'Content fields', 'smart-custom-fields' ), 'options' => array(), ), 'other-fields' => array( 'label' => esc_attr__( 'Other fields', 'smart-custom-fields' ), 'options' => array(), ), ); } /** * Get Current Admin Color Scheme. * * @return object */ protected function admin_color_scheme() { global $_wp_admin_css_colors; $user_admin_color_scheme = get_user_option( 'admin_color' ); $colors_obj = $_wp_admin_css_colors[ $user_admin_color_scheme ]; return $colors_obj; } /** * Add Custom Inline CSS on Admin Dashboard. */ public function admin_inline_css() { $colors = $this->admin_color_scheme()->colors; ?> esc_html__( 'Same name exists!', 'smart-custom-fields' ), 'autocomplete_placeholder' => esc_html__( 'Type to search a post or page', 'smart-custom-fields' ), 'loading' => esc_html__( 'Loading...', 'smart-custom-fields' ), 'load_more' => esc_html__( 'Load more', 'smart-custom-fields' ), 'rest_api_url' => rest_url( SCF_Config::PREFIX . 'api/v2/search/posts' ), 'nonce' => wp_create_nonce( 'wp_rest' ), ) ); wp_enqueue_script( 'jquery-ui-sortable' ); do_action( SCF_Config::PREFIX . 'after-settings-enqueue-scripts' ); } /** * Adding meta boxes. */ public function add_meta_boxes() { add_meta_box( SCF_Config::PREFIX . 'meta-box', __( 'Custom Fields', 'smart-custom-fields' ), array( $this, 'display_meta_box' ), SCF_Config::NAME ); add_meta_box( SCF_Config::PREFIX . 'meta-box-condition-post', __( 'Display conditions ( Post )', 'smart-custom-fields' ), array( $this, 'display_meta_box_condition_post' ), SCF_Config::NAME, 'side' ); add_meta_box( SCF_Config::PREFIX . 'meta-box-condition-profile', __( 'Display conditions ( Profile )', 'smart-custom-fields' ), array( $this, 'display_meta_box_condition_profile' ), SCF_Config::NAME, 'side' ); add_meta_box( SCF_Config::PREFIX . 'meta-box-condition-taxonomy', __( 'Display conditions ( Taxonomy )', 'smart-custom-fields' ), array( $this, 'display_meta_box_condition_taxonomy' ), SCF_Config::NAME, 'side' ); add_meta_box( SCF_Config::PREFIX . 'meta-box-condition-options-page', __( 'Display conditions ( Options page )', 'smart-custom-fields' ), array( $this, 'display_meta_box_condition_options_page' ), SCF_Config::NAME, 'side' ); } /** * Displaying "hide" if $key isn't empty. * * @param string $key Key. */ private function add_hide_class( $key ) { if ( ! $key ) { echo 'hide'; } } /** * Displaying custom fields. */ public function display_meta_box() { $setting = SCF::add_setting( get_the_ID(), get_the_title() ); $setting->add_group_unshift(); $groups = $setting->get_groups(); ?>
    $group ) : ?> get_fields(); array_unshift( $fields, SCF::get_form_field_instance( 'text' ) ); ?>
    display_options( $group_key ); ?>
    $field ) : ?>
    get( 'name' ); $field_label = $field->get( 'label' ); if ( ! $field_label ) { $field_label = $field_name; if ( ! $field_label ) { $field_label = ' '; } } ?>
    [ ]
    display_options( $group_key, $field_key ); ?>
    *
    true, ), 'objects' ); unset( $post_types['attachment'] ); unset( $post_types['wp_block'] ); unset( $post_types[ SCF_Config::NAME ] ); $conditions = get_post_meta( get_the_ID(), SCF_Config::PREFIX . 'condition', true ); $post_type_field = ''; foreach ( $post_types as $post_type => $post_type_object ) { $current = is_array( $conditions ) && in_array( $post_type, $conditions, true ) ? $post_type : false; $post_type_field .= sprintf( '', esc_attr( SCF_Config::PREFIX . 'condition[]' ), esc_attr( $post_type ), checked( $current, $post_type, false ), esc_attr( $post_type_object->labels->singular_name ) ); } printf( // Translators: %1$s: Label, %2$s: Post type field '

    %1$s%2$s

    ', esc_html__( 'Post Types', 'smart-custom-fields' ), $post_type_field // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); $condition_post_ids = get_post_meta( get_the_ID(), SCF_Config::PREFIX . 'condition-post-ids', true ); // get all posts saved $saved_posts = explode( ',', $condition_post_ids ); if ( $saved_posts ) { $saved = array(); foreach ( $saved_posts as $k => $post_id ) { if ( '' !== $post_id ) { $saved[ $k ]['id'] = $post_id; $saved[ $k ]['text'] = $post_id; } } } // create variable js with posting IDs to use in post search results printf( '', wp_json_encode( array_values( $saved ) ) ); // create div to use with jquery plugin "selectivity" // https://github.com/arendjr/selectivity printf( '

    %s

    ', esc_html__( 'Post or Page Ids', 'smart-custom-fields' ), esc_attr( SCF_Config::PREFIX . 'autocomplete-condition-post' ) ); // create input hidden with the IDS of saved posts printf( // Translators: %1$s: name, %2$s: value '', esc_attr( SCF_Config::PREFIX . 'condition-post-ids' ), esc_attr( $condition_post_ids ) ); } /** * Displaying the meta box to set the display conditions for profile edit page. */ public function display_meta_box_condition_profile() { $roles = get_editable_roles(); $conditions = get_post_meta( get_the_ID(), SCF_Config::PREFIX . 'roles', true ); $profile_field = ''; foreach ( $roles as $name => $role ) { $current = is_array( $conditions ) && in_array( $name, $conditions, true ) ? $name : false; $profile_field .= sprintf( '', esc_attr( SCF_Config::PREFIX . 'roles[]' ), esc_attr( $name ), checked( $current, $name, false ), // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText esc_html__( $role['name'], 'smart-custom-fields' ) ); } printf( // Translators: %1$s: Label, %2$s: Roles field '

    %1$s%2$s

    ', esc_html__( 'Roles', 'smart-custom-fields' ), $profile_field // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } /** * Displaying the meta box to set the display conditions for term edit page. */ public function display_meta_box_condition_taxonomy() { $taxonomies = get_taxonomies( array( 'show_ui' => true, ), 'objects' ); $conditions = get_post_meta( get_the_ID(), SCF_Config::PREFIX . 'taxonomies', true ); $taxonomy_field = ''; foreach ( $taxonomies as $name => $taxonomy ) { $current = is_array( $conditions ) && in_array( $name, $conditions, true ) ? $name : false; $taxonomy_field .= sprintf( '', esc_attr( SCF_Config::PREFIX . 'taxonomies[]' ), esc_attr( $name ), checked( $current, $name, false ), // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText esc_html__( $taxonomy->label, 'smart-custom-fields' ) ); } printf( // Translators: %1$s: Label, %2$s: Taxonomy field '

    %1$s%2$s

    ', esc_html__( 'Taxonomies', 'smart-custom-fields' ), $taxonomy_field // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } /** * Displaying the meta box to set the display conditions for custom options page. */ public function display_meta_box_condition_options_page() { $optinos_pages = SCF::get_options_pages(); $conditions = get_post_meta( get_the_ID(), SCF_Config::PREFIX . 'options-pages', true ); $options_page_field = ''; foreach ( $optinos_pages as $name => $optinos_page ) { $current = is_array( $conditions ) && in_array( $name, $conditions, true ) ? $name : false; $options_page_field .= sprintf( '', esc_attr( SCF_Config::PREFIX . 'options-pages[]' ), esc_attr( $name ), checked( $current, $name, false ), esc_html( $optinos_page ) ); } printf( // Translators: %1$s: Label, %2$s: Options page field '

    %1$s%2$s

    ', esc_html__( 'Options pages', 'smart-custom-fields' ), $options_page_field // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } /** * Saving settings. * * @param int $post_id The post id. */ public function save_post( $post_id ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } $posted_data = filter_input( INPUT_POST, SCF_Config::NAME, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( ! $posted_data ) { return; } check_admin_referer( SCF_Config::NAME . '-settings', SCF_Config::PREFIX . 'settings-nonce' ); $data = array(); foreach ( $posted_data as $group_key => $group_value ) { // $group_key = 0 is hidden field so don't save if ( 0 === $group_key ) { continue; } if ( ! empty( $group_value['fields'] ) && count( $group_value['fields'] ) > 1 ) { $fields = array(); foreach ( $group_value['fields'] as $field_key => $field_value ) { // $field_key = 0 is hidden field so don't save if ( 0 === $field_key ) { continue; } if ( ! empty( $field_value['name'] ) ) { $fields[] = $field_value; } } if ( ! $fields ) { continue; } if ( ! empty( $group_value['repeat'] ) && 'true' === $group_value['repeat'] ) { $group_value['repeat'] = true; } else { $group_value['repeat'] = false; } // If "repeat" isn't true, empty name // If "repeat" is true and name is empty, assign index if ( ! isset( $group_value['repeat'] ) || true !== $group_value['repeat'] || empty( $group_value['group-name'] ) ) { $group_value['group-name'] = $group_key; } $group_value['fields'] = $fields; $data[] = $group_value; } } update_post_meta( $post_id, SCF_Config::PREFIX . 'setting', $data ); $poste_condition = filter_input( INPUT_POST, SCF_Config::PREFIX . 'condition', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( ! $poste_condition ) { delete_post_meta( $post_id, SCF_Config::PREFIX . 'condition' ); } else { update_post_meta( $post_id, SCF_Config::PREFIX . 'condition', $poste_condition ); } $poste_condition_post_ids = filter_input( INPUT_POST, SCF_Config::PREFIX . 'condition-post-ids' ); if ( ! $poste_condition_post_ids ) { delete_post_meta( $post_id, SCF_Config::PREFIX . 'condition-post-ids' ); } else { update_post_meta( $post_id, SCF_Config::PREFIX . 'condition-post-ids', $poste_condition_post_ids ); } $poste_roles = filter_input( INPUT_POST, SCF_Config::PREFIX . 'roles', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( ! $poste_roles ) { delete_post_meta( $post_id, SCF_Config::PREFIX . 'roles' ); } else { update_post_meta( $post_id, SCF_Config::PREFIX . 'roles', $poste_roles ); } $poste_taxonomies = filter_input( INPUT_POST, SCF_Config::PREFIX . 'taxonomies', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( ! $poste_taxonomies ) { delete_post_meta( $post_id, SCF_Config::PREFIX . 'taxonomies' ); } else { update_post_meta( $post_id, SCF_Config::PREFIX . 'taxonomies', $poste_taxonomies ); } $poste_options_pages = filter_input( INPUT_POST, SCF_Config::PREFIX . 'options-pages', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( ! $poste_options_pages ) { delete_post_meta( $post_id, SCF_Config::PREFIX . 'options-pages' ); } else { update_post_meta( $post_id, SCF_Config::PREFIX . 'options-pages', $poste_options_pages ); } } } classes/controller/class.profile.php000064400000003724146726725200013662 0ustar00%s', esc_html__( 'Custom Fields', 'smart-custom-fields' ) ); $settings = SCF::get_settings( $user ); $callback_args = array(); foreach ( $settings as $setting ) { $callback_args['args'] = $setting->get_groups(); ?>
    get_title() ); ?> display_meta_box( $user, $callback_args ); ?>
    save( filter_input_array( INPUT_POST ), get_userdata( $user_id ) ); } } classes/controller/class.editor.php000064400000002704146726725200013505 0ustar00get_id(), $setting->get_title(), array( $this, 'display_meta_box' ), $post_type, 'normal', 'default', $setting->get_groups() ); } } /** * Saving meta data from custom fields in post edit page. * * @param int $post_id Post id. */ public function save_post( $post_id ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) { return; } if ( ! filter_input( INPUT_POST, SCF_Config::NAME, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ) ) { return; } $this->save( filter_input_array( INPUT_POST ), get_post( $post_id ) ); } } vendor/composer/autoload_namespaces.php000064400000000213146726725200014417 0ustar00= 70400)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( 'Composer detected issues in your platform: ' . implode(' ', $issues), E_USER_ERROR ); } vendor/composer/autoload_classmap.php000064400000000336146726725200014111 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); vendor/composer/installed.php000064400000001271146726725200012374 0ustar00 array( 'name' => '__root__', 'pretty_version' => '1.0.0+no-version-set', 'version' => '1.0.0.0', 'reference' => null, 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => false, ), 'versions' => array( '__root__' => array( 'pretty_version' => '1.0.0+no-version-set', 'version' => '1.0.0.0', 'reference' => null, 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); vendor/composer/InstalledVersions.php000064400000037417146726725200014100 0ustar00 * Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; /** * This class is copied in every Composer installed project and available to all * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` * * @final */ class InstalledVersions { /** * @var mixed[]|null * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ private static $installedByVendor = array(); /** * Returns a list of all package names which are present, either by being installed, replaced or provided * * @return string[] * @psalm-return list */ public static function getInstalledPackages() { $packages = array(); foreach (self::getInstalled() as $installed) { $packages[] = array_keys($installed['versions']); } if (1 === \count($packages)) { return $packages[0]; } return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); } /** * Returns a list of all package names with a specific type e.g. 'library' * * @param string $type * @return string[] * @psalm-return list */ public static function getInstalledPackagesByType($type) { $packagesByType = array(); foreach (self::getInstalled() as $installed) { foreach ($installed['versions'] as $name => $package) { if (isset($package['type']) && $package['type'] === $type) { $packagesByType[] = $name; } } } return $packagesByType; } /** * Checks whether the given package is installed * * This also returns true if the package name is provided or replaced by another package * * @param string $packageName * @param bool $includeDevRequirements * @return bool */ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } return false; } /** * Checks whether the given package satisfies a version constraint * * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: * * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') * * @param VersionParser $parser Install composer/semver to have access to this class and functionality * @param string $packageName * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package * @return bool */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } /** * Returns a version constraint representing all the range(s) which are installed for a given package * * It is easier to use this via isInstalled() with the $constraint argument if you need to check * whether a given version of a package is installed, and not just whether it exists * * @param string $packageName * @return string Version constraint usable with composer/semver */ public static function getVersionRanges($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } $ranges = array(); if (isset($installed['versions'][$packageName]['pretty_version'])) { $ranges[] = $installed['versions'][$packageName]['pretty_version']; } if (array_key_exists('aliases', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); } if (array_key_exists('replaced', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); } if (array_key_exists('provided', $installed['versions'][$packageName])) { $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); } return implode(' || ', $ranges); } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['version'])) { return null; } return $installed['versions'][$packageName]['version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present */ public static function getPrettyVersion($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['pretty_version'])) { return null; } return $installed['versions'][$packageName]['pretty_version']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference */ public static function getReference($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } if (!isset($installed['versions'][$packageName]['reference'])) { return null; } return $installed['versions'][$packageName]['reference']; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @param string $packageName * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. */ public static function getInstallPath($packageName) { foreach (self::getInstalled() as $installed) { if (!isset($installed['versions'][$packageName])) { continue; } return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; } throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); } /** * @return array * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { $installed = self::getInstalled(); return $installed[0]['root']; } /** * Returns the raw installed.php data for custom implementations * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); } } return self::$installed; } /** * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] * @psalm-return list}> */ public static function getAllRawData() { return self::getInstalled(); } /** * Lets you reload the static array from another file * * This is only useful for complex integrations in which a project needs to use * this class but then also needs to execute another project's autoloader in process, * and wants to ensure both projects have access to their version of installed.php. * * A typical case would be PHPUnit, where it would need to make sure it reads all * the data it needs from this class, then call reload() with * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure * the project in which it runs can then also use this class safely, without * interference between PHPUnit's dependencies and the project's dependencies. * * @param array[] $data A vendor/composer/installed.php data set * @return void * * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ private static function getInstalled() { if (null === self::$canGetVendors) { self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } } } if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } vendor/composer/ClassLoader.php000064400000037772146726725200012630 0ustar00 * Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier * @author Jordi Boggiano * @see https://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { /** @var \Closure(string):void */ private static $includeFile; /** @var string|null */ private $vendorDir; // PSR-4 /** * @var array> */ private $prefixLengthsPsr4 = array(); /** * @var array> */ private $prefixDirsPsr4 = array(); /** * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * List of PSR-0 prefixes * * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) * * @var array>> */ private $prefixesPsr0 = array(); /** * @var list */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var array */ private $missingClasses = array(); /** @var string|null */ private $apcuPrefix; /** * @var array */ private static $registeredLoaders = array(); /** * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return array> */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return list */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return list */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return array Array of classname => path */ public function getClassMap() { return $this->classMap; } /** * @param array $classMap Class to filename map * * @return void */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param list|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param list|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param list|string $paths The PSR-0 base directories * * @return void */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * * @return void */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath * * @return void */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative * * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix * * @return void */ public function setApcuPrefix($apcuPrefix) { $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** * The APCu prefix in use, or null if APCu caching is not enabled. * * @return string|null */ public function getApcuPrefix() { return $this->apcuPrefix; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not * * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } } /** * Unregisters this instance as an autoloader. * * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); if (null !== $this->vendorDir) { unset(self::$registeredLoaders[$this->vendorDir]); } } /** * Loads the given class or interface. * * @param string $class The name of the class * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } if (null !== $this->apcuPrefix) { $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if (false === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if (null !== $this->apcuPrefix) { apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; } return $file; } /** * Returns the currently registered loaders keyed by their corresponding vendor directories. * * @return array */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } /** * @param string $class * @param string $ext * @return string|false */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { if (file_exists($file = $dir . $pathEnd)) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } return false; } /** * @return void */ private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; } /** * Scope isolated include. * * Prevents access to $this/self from included files. * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } } vendor/composer/installed.json000064400000000106146726725200012552 0ustar00{ "packages": [], "dev": false, "dev-package-names": [] } vendor/composer/autoload_real.php000064400000002161146726725200013227 0ustar00register(true); return $loader; } } vendor/composer/LICENSE000064400000002056146726725200010713 0ustar00 Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. vendor/composer/autoload_static.php000064400000001050146726725200013567 0ustar00 __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->classMap = ComposerStaticInita33ab1047730fe744941add9e8020420::$classMap; }, null, ClassLoader::class); } } vendor/composer/autoload_psr4.php000064400000000205146726725200013171 0ustar00=7.4" }, "require-dev": { "wp-coding-standards/wpcs": "^3.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "yoast/phpunit-polyfills": "^1.0", "phpcompatibility/phpcompatibility-wp": "*" }, "scripts" :{ "format": "phpcbf --standard=./.phpcs.xml.dist --report-summary --report-source", "lint": "phpcs --standard=./.phpcs.xml.dist" }, "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } } } libs/iosCheckbox/iosCheckbox.min.js000064400000001133146726725200013330 0ustar00!function(e){e.fn.extend({iosCheckbox:function(){if(this.destroy=function(){e(this).each(function(){e(this).next(".ios-ui-select").remove()})},"true"!==e(this).attr("data-ios-checkbox"))return e(this).attr("data-ios-checkbox","true"),e(this).each(function(){var c=e(this),i=jQuery("
    ",{class:"ios-ui-select"}).append(jQuery("
    ",{class:"inner"}));if(c.is(":checked")&&i.addClass("checked"),c.hide().after(i),c.is(":disabled"))return i.css("opacity","0.6");i.click(function(){i.toggleClass("checked"),i.hasClass("checked")?c.prop("checked",!0):c.prop("checked",!1),c.click()})}),this}})}(jQuery); libs/iosCheckbox/iosCheckbox.js000064400000004533146726725200012555 0ustar00/** * iosCheckbox.js * Version: 1.0.0 * Author: Ron Masas */ (function($) { $.fn.extend({ iosCheckbox: function() { this.destroy = function(){ $(this).each(function() { $(this).next('.ios-ui-select').remove(); }); }; if ($(this).attr('data-ios-checkbox') === 'true') { return; } $(this).attr('data-ios-checkbox', 'true'); $(this).each(function() { /** * Original checkbox element */ var org_checkbox = $(this); /** * iOS checkbox div */ var ios_checkbox = jQuery("
    ", { class: 'ios-ui-select' }).append(jQuery("
    ", { class: 'inner' })); // If the original checkbox is checked, add checked class to the ios checkbox. if (org_checkbox.is(":checked")) { ios_checkbox.addClass("checked"); } // Hide the original checkbox and print the new one. org_checkbox.hide().after(ios_checkbox); if (org_checkbox.is(":disabled")){ // In case the original checkbox is disabled don't register the click event. return ios_checkbox.css('opacity','0.6'); } // Add click event listener to the ios checkbox ios_checkbox.click(function() { // Toggel the check state ios_checkbox.toggleClass("checked"); // Check if the ios checkbox is checked if (ios_checkbox.hasClass("checked")) { // Update state org_checkbox.prop('checked', true); } else { // Update state org_checkbox.prop('checked', false); } // Run click even in case it was registered to the original checkbox element. org_checkbox.click(); }); }); return this; } }); })(jQuery); libs/iosCheckbox/iosCheckbox.min.css000064400000001760146726725200013512 0ustar00.ios-ui-select{border:none;height:36px;background:#ddd;-webkit-border-radius:18px;border-radius:18px;width:60px;-webkit-transition:all .3s ease-in-out;-moz-transition:all .3s ease-in-out;-ms-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;position:relative;display:inline-block}.ios-ui-select.checked{-webkit-box-shadow:inset 0 0 0 36px #6ddc5f;box-shadow:inset 0 0 0 36px #6ddc5f}.ios-ui-select.checked .inner{left:27px}.ios-ui-select .inner{width:30px;height:30px;position:absolute;top:3px;left:3px;-webkit-border-radius:100%;border-radius:100%;background:#fff;-webkit-transition:all 350ms cubic-bezier(0,.89,.44,1);-moz-transition:all 350ms cubic-bezier(0,.89,.44,1);-o-transition:all 350ms cubic-bezier(0,.89,.44,1);transition:all 350ms cubic-bezier(0,.89,.44,1);-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.1);box-shadow:0 1px 2px 0 rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.1)}libs/iosCheckbox/README.md000064400000002027146726725200011231 0ustar00iosCheckbox.js ============== A jQuery plugin that transform any checkbox element into a beautiful ios style checkbox. ![alt tag](http://s15.postimg.org/gbyj9pzk7/ios_Checbox.png) Demo: http://jsfiddle.net/bttkc3jg/31/ Demo Alternative Theme: http://jsfiddle.net/5xzevfq7/9/ Usage: Include the css ```html ``` Add some checkboxs to your page ```html ``` Load jQuery and iosCheckbox ```html ``` Transform all checkboxs with the class of `ios` ```html ``` We also have a Zepto based version thanks to [LeoUnglaub](https://github.com/LeoUnglaub) you can find it in [here](https://bitbucket.org/foxship/ioscheckbox.js) libs/iosCheckbox/iosCheckbox.css000064400000007315146726725200012732 0ustar00.ios-ui-select{ background: #dddddd; border: none; height: 36px; background: #dddddd; -webkit-border-radius: 18px; border-radius: 18px; width: 60px; -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; -webkit-box-shadow: none; box-shadow: none; cursor: pointer; position: relative; display: inline-block; } .ios-ui-select.checked{ -webkit-box-shadow: inset 0 0 0 36px #6ddc5f; box-shadow: inset 0 0 0 36px #6ddc5f; } .ios-ui-select.checked .inner{ left: 27px; } .ios-ui-select .inner{ width: 30px; height: 30px; position: absolute; top: 3px; left: 3px; -webkit-border-radius: 100%; border-radius: 100%; background: white; -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2),0 3px 4px 0 rgba(0,0,0,0.1); box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2),0 3px 4px 0 rgba(0,0,0,0.1); } /* Alternative Theme */ /* ---------------- */ /* .ios-ui-select{ border-color: #d1d1d1; width: 28px; height: 28px; -webkit-border-radius: 100%; border-radius: 100%; opacity: 1; -webkit-box-shadow: inset 0 0 0 2px #d6e0e6; box-shadow: inset 0 0 0 2px #d6e0e6; width: 22px; z-index: 2; text-align: center; display: inline-block; cursor: pointer; height: 22px; -webkit-border-radius: 18px; border-radius: 18px; -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); text-indent: -9999px; display: inline-block; } .ios-ui-select.checked { -webkit-box-shadow: inset 0 0 0 14px #4ad337; box-shadow: inset 0 0 0 14px #4ad337; opacity: 1 !important; } .ios-ui-select.checked .inner{ -moz-transform: scale(1); -webkit-transform: scale(1); -o-transform: scale(1); -ms-transform: scale(1); transform: scale(1); } .ios-ui-select .inner{ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAQAAADa613fAAAC70lEQVR42u3bPWgUQRgG4N0kxpjCYJFCFBVRCyFg0PgD/oAiKpGgAUEwhVhoI4I2FoIpxDSmCBZqIYopRMEUWiSIiilEBEEwKCgHRgwqKsIhxngQ89qYkMu9iTuzs7N74Z0rb+bbe/Z2Z+b79i5EMDtaRSCIIIIIIogggggiiCCCCCKIIIIIIogggggyWyE15Q+ZF3QF+WAkeB20GI1Dtl616Md4G0Nr9JHZYlSjD5PbIMJyhFSiB1Pb8qijs3OPhMH1oDXGPZyRbyPEFZS2j6got0urE6y1ldvN3k4Z7SYxssA4RRmdZlHSZxzDGGFcjj7xZgPShj+E0W3KSBuyH6OE0YNK81hpMnajQBi9qLaJlh5jG4YJ4zFq7eKlxdiAPGE8w3zbiOkwGvCdMAawwD5mGoxV+EIYb1AfJ6p/xjIMEcY7LI4X1zdjEXKEMYQVcSObda9CE9ahyvpw9XhFGF+xOv4pMuncjE//Ntd7rA5WhxeEkccaF9919K6Nk5avAvZaZONPCeMnNrq5aKN3vVX0AX5hu9GBavCIMEyjOIHkSs7lJoOiwj3CKKDZ3TQSvetLcnU3Riwq3CaMURxwOR9G79phOd+EuEZGjuGw24ndZM6xWwEu0vzvuOsVyqTzUromD864JndQxmn3S61Z95V0l/R22l3SGco4l8SeIcl96wnK6Epm82M+ZP00mUTdlH5HaFHhqnk2ntymcSvN7fqLcruDNBu/aZONJ7n73UWz7b6JbLuFvn8Xc5LbV9sO3DdD/WMHfpP3HtgVFZLPRw5RSjc20wvviW1RwUdidZTezqzg9rxkKsgUJMBJRGkD8bJxP6nu2f8ycljoI4mOH+LCjIwPWOKnGuDiWdOlaRmf4xcVfFZRQtygjG9o8FefcfU89g5Ju5p8FprcPSHvLWIMY4vfipnL3yw8nGCMYKfvCqbLYHNxHu/xA/ex1n9FOdQfKgURRBBBBBFEEEEEEUQQQQQRRBBBBBFEEEHG21/sNjJ4iVKmQwAAAABJRU5ErkJggg==) center center no-repeat; background-size: 100%; width: 100%; height: 100%; content: ''; -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1); -moz-transform: scale(0); -webkit-transform: scale(0); -o-transform: scale(0); -ms-transform: scale(0); transform: scale(0); } */ libs/selectivity-3.1.0/selectivity-jquery.css000064400000011360146726725200015105 0ustar00/** * All CSS that comes with Selectivity.js can be used as is, or tweaked to your heart's content :) * * Please realize though there is no "API contract" regarding styling of CSS classes, meaning that * any customized CSS made may need to be updated without warning if you want to upgrade the * Selectivity version you use. You can mitigate this problem by using your own templates instead of * those defined in src/templates.js, since templates will at the very least continue working across * patch versions and any changes necessary to templates will be documented in the changelog. */ .selectivity-clearfix { clear: both; } .selectivity-input { display: inline-block; width: 250px; } .selectivity-input select { display: none; } .selectivity-input:focus { outline: none; } .selectivity-placeholder { color: #999; } /** * Dropdown */ .selectivity-dropdown { background: #fff; border-radius: 4px; -webkit-box-shadow: 0 1px 5px 1px rgba(0, 0, 0, 0.15), 0 10px 16px 0 rgba(0, 0, 0, 0.2); box-shadow: 0 1px 5px 1px rgba(0, 0, 0, 0.15), 0 10px 16px 0 rgba(0, 0, 0, 0.2); position: fixed; z-index: 1046; } .selectivity-search-input-container { border-bottom: 1px solid #eee; } .selectivity-search-input { background: transparent; border: 0; outline: 0; width: 100%; } .selectivity-results-container { max-height: 28em; overflow: auto; position: relative; } .selectivity-load-more, .selectivity-result-item { cursor: pointer; padding: 7px; } .selectivity-result-children .selectivity-result-item { padding-left: 17px; } .selectivity-load-more.highlight, .selectivity-result-item.highlight { background: #4484c7; color: #fff; } .selectivity-result-item.disabled { cursor: default; color: #999; } .selectivity-result-item:first-child { border-radius: 4px 4px 0 0; } .selectivity-dropdown.has-search-input .selectivity-result-item:first-child { border-radius: 0; } .selectivity-result-label { font-weight: bold; } .selectivity-load-more, .selectivity-result-item:last-child, .selectivity-result-children:last-child .selectivity-result-item:last-child { border-radius: 0 0 4px 4px; } .selectivity-result-children .selectivity-result-item:last-child { border-radius: 0; } .selectivity-error, .selectivity-loading, .selectivity-search-input-container, .selectivity-result-label { padding: 7px; } /** * Multi-selection input */ .selectivity-multiple-input-container { background: #eee; border-radius: 2px; cursor: text; max-height: 10em; min-height: calc(2em + 4px); overflow: auto; padding: 5px; } .selectivity-multiple-input-container .selectivity-placeholder { height: calc(2em + 4px); line-height: calc(2em + 4px); } .selectivity-multiple-input, input[type='text'].selectivity-multiple-input { background-color: transparent; border: none; float: left; font: inherit; height: calc(2em + 4px); max-width: 100%; outline: 0; padding: 0; } .selectivity-multiple-input:focus, input[type='text'].selectivity-multiple-input:focus { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; outline: none; } .selectivity-multiple-input::-ms-clear { display: none; } .selectivity-multiple-selected-item { background: #4484c7; border-radius: 3px; color: #fff; cursor: default; float: left; line-height: 2em; margin: 2px; padding: 0 5px; position: relative; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; user-select: none; white-space: nowrap; } .selectivity-multiple-selected-item.highlighted { background-color: #ccc; } .selectivity-multiple-selected-item-remove { color: #fff; cursor: pointer; margin-left: -5px; padding: 5px; } /** * Single-selection input */ .selectivity-single-select { background: #eee; border-radius: 2px; cursor: pointer; min-height: 2em; padding: 5px; position: relative; -webkit-box-sizing: content-box; box-sizing: content-box; } .selectivity-single-select-input { opacity: 0; } .selectivity-single-result-container { position: absolute; top: 0.8em; right: 15px; left: 5px; overflow: hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; } .selectivity-single-selected-item { color: #000; } .selectivity-single-selected-item-remove { color: #000; float: right; padding: 0 5px; position: relative; z-index: 1; } .selectivity-caret { position: absolute; right: 5px; top: 0.7em; } @media only screen and (max-device-width: 480px) { .selectivity-single-select { background: #eee; border-radius: 2px; } .selectivity-single-result-container { right: 5px; } .selectivity-caret { display: none; } } /** * Submenu */ .selectivity-submenu-icon { position: absolute; right: 4px; } libs/selectivity-3.1.0/README.md000064400000047344146726725200012004 0ustar00# Selectivity.js Modular and light-weight selection library. [![Selectivity on NPM](https://img.shields.io/npm/v/selectivity.svg)](https://www.npmjs.com/package/selectivity) [![Build Status](https://travis-ci.org/arendjr/selectivity.svg?branch=master)](https://travis-ci.org/arendjr/selectivity) [![Greenkeeper badge](https://badges.greenkeeper.io/arendjr/selectivity.svg)](https://greenkeeper.io/) ## Setup ### Dependencies Selectivity doesn't require any external libraries to be loaded on your page, but it does have some optional dependencies: - There's a React build that provides the official Selectivity React API. If you wish to use this, [React](https://facebook.github.io/react/) should be loaded on your page. - There's a jQuery build that provides the official Selectivity jQuery API. If you wish to use this, either [jQuery](http://jquery.com/) or [Zepto.js](http://zeptojs.com/) should be loaded on your page. - The default templates assume that you have included [FontAwesome](http://fortawesome.github.io/Font-Awesome/) in your page to display the icons. If you do not want this, please specify custom templates. ### Manual **Warning:** Do you use Browserify or Webpack? Please use Yarn or NPM as described below. Download and unpack the latest release from the project website: https://arendjr.github.io/selectivity/ Copy the JavaScript and CSS file for your desired build from the archive into your project. See the following table to see which files you need: | Build | JavaScript file | CSS file | | ------------------------- | ------------------------- | -------------------------- | | jQuery (development) | selectivity-jquery.js | selectivity-jquery.css | | jQuery (production) | selectivity-jquery.min.js | selectivity-jquery.min.css | | React (development) | selectivity-react.js | selectivity-react.css | | React (production) | selectivity-react.min.js | selectivity-react.min.css | | _VanillaJS_ (development) | selectivity.js | selectivity.css | | _VanillaJS_ (production) | selectivity.min.js | selectivity.min.css | Reference the files from your HTML page like this: ... ... ... Note the first line includes FontAwesome which is required for the default icons. This line is optional if you use custom templates. The second line should reference the CSS file from the bundle you chose to use. The third line should reference jQuery, React or Zepto.js as appropriate. This line is optional if you use the VanillaJS bundle. _Note: If you want to use the React templates plugin, don't forget to also include `react-dom.js`._ Finally, the last line should reference the JavaScript file from the bundle you chose to use. You are now ready to start using Selectivity as described on the Selectivity homepage: https://arendjr.github.io/selectivity/ ### Using Yarn If you have Yarn installed, run: $ yarn add selectivity Note you will need to include the CSS yourself. You can find it in `node_modules/selectivity/selectivity.css`. ### Using NPM Make sure you have Node.js installed and run: $ npm install --save selectivity Note you will need to include the CSS yourself. You can find it in `node_modules/selectivity/selectivity.css`. #### Which module do I require? You can `require()` Selectivity as follows: var Selectivity = require('selectivity'); But, this will only expose the main Selectivity object and will load none of the plugins, nor enable any of the specialized APIs. You could say what you're getting is the core of the VanillaJS API. If however, you just want to use the jQuery API with all the relevant plugins loaded, you can do this: require('selectivity/jquery'); After this you can call the jQuery API as you would expect: $('...').selectivity(/*...*/); Similarly, if you want to use the React API with all its relevant plugins, you can do this: var Selectivity = require('selectivity/react'); The Selectivity object you receive is the same one as if you'd required `'selectivity'`, but you get the React Component class as `Selectivity.React` so you can use it as follows: Finally, if you're an expert (\*) you can choose to use the VanillaJS API and enable just the plugins you want one by one. For example: var Selectivity = require('selectivity'); require('selectivity/dropdown'); require('selectivity/inputs/single'); require('selectivity/plugins/ajax'); require('selectivity/plugins/async'); require('selectivity/plugins/submenu'); var singleInput = new Selectivity.Inputs.Single({ element: document.querySelector('...'), /*...*/ }); All the modules listed in the table below under _Creating custom builds_ can be required this way. \*) Using the VanillaJS API isn't really that hard, but all the examples and documentation assume you're using either the React or the jQuery API, so be prepared that you'll have to figure out a bit more on your own. ### Ruby on Rails Detailed information for `selectivity-rails`, including [Installation and usage](https://github.com/msx2/selectivity-rails#installation-and-usage) are provided in the [gem's repository](https://github.com/msx2/selectivity-rails). ### Customization Once installed, you may want to customize Selectivity. For example, by specifying custom templates or localized strings. While creating a custom build is always an option (see details below), easier options exist. To do any basic customization, you'll need a reference to the `Selectivity` object. If you have installed through Yarn/NPM, you can get this object through `var Selectivity = require('selectivity');`. If you're using a jQuery build, the object is exposed as `$.Selectivity`. For non-jQuery builds that you included as a script, the object is exposed as global variable. #### Example: Customizing localization in a jQuery build $.Selectivity.Locale.noResultsForTerm = function(term) { return 'No results were found for ' + escape(term) + ''; }; See [locale.js](https://github.com/arendjr/selectivity/blob/master/src/locale.js) for an overview of all localizable messages. #### Example: Specifying a custom template when installed through NPM var Selectivity = require('selectivity'); Selectivity.Templates.loading = function() { return '
    '; }; See [templates.js](https://github.com/arendjr/selectivity/blob/master/src/templates.js) for an overview of all templates that can be customized. ## API For usage instructions, please see the Selectivity homepage: https://arendjr.github.io/selectivity/ ## Browser Support - Chrome - Firefox - Internet Explorer 10+ - Safari 6+ Note that while Internet Explorer versions older than 10 are not supported, you might be able to get them to work, possibly with the use of some polyfills. Reports of success or patches to create a "legacy" build would be welcomed. ## Build System Selectivity is built modularly and uses Yarn and Gulp as a build system to build its distributable files. Make sure you have the `yarn` command globally available and make sure you have the `sass` Gem installed. Then, inside the project directory, run: $ yarn Now you can generate new distributable files from the sources, using: $ yarn build ### Creating custom builds If you want to create your own Selectivity library that contains just the modules you need, you can use the following command: $ yarn gulp [--api=] --modules= The following modules are available: | Module | Description | | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **inputs/email** | Implements the 'Email' input type. This is a special case of the 'Multiple' input type with no dropdown and a specialized tokenizer for recognizing email addresses (including pasted content from address books). | | **inputs/multiple** | Implements the 'Multiple' input type. If you only want to use Selectivity with single values, you can leave this out. | | **inputs/single** | Implements the 'Single' input type. If you only want to use Selectivity with multiple values, you can leave this out. | | **plugins/ajax** | Convenience module for performing AJAX requests. Needed if you want to use any `ajax` options. If you use this module, you should also include the 'async' module to correctly handle out-of-order replies. This module relies on the presence of the `[fetch()](https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch)` method which is only available in modern browsers, so you should either provide a polyfill if you want to support older browsers, or -- if you're creating a jQuery build -- you can use the 'jquery/ajax' module to provide a fallback that uses `$.ajax()` instead. | | **plugins/async** | Blocks the query function from calling its callback functions if another query has been issued since. This prevents out-of-order replies from remote sources to display incorrect results. This module is only needed if you use the query function and call its callbacks asynchronously. | | **plugins/diacritics** | Diacritics support. This will make sure that `"Łódź"` will match when the user searches for `"Lodz"`, for example. However, if you always query a server when searching for results, you may want to solve matching of diacritics server-side, in which case this module can be omitted. | | **plugins/keyboard** | Provides keyboard support for navigating through the dropdown. If you don't use a dropdown, or are only targeting mobile, you may want to leave this module out. | | **plugins/submenu** | Extends the default dropdown so that multiple levels of submenus can be created. | | **plugins/tokenizer** | Default tokenizer implementation. This module adds support for the `tokenSeparators` option which is used by the default tokenizer. Support for tokenizers themselves is already included in the "multiple" module, so you can omit this module if you don't want to use any tokenizers or want to specify your own tokenizer. | | **plugins/jquery/ajax** | Provides a fallback to use `$.ajax()` instead of the `fetch()` method for performing AJAX requests. _(Requires jQuery 3.0 or higher)_ | | **plugins/jquery/traditional** | This module allows you to convert an HTML5 ` boxes into Selectivity * instances. */ Selectivity.OptionListeners.push(function(selectivity, options) { var $el = $(selectivity.el); if ($el.is('select')) { if ($el.attr('autofocus')) { setTimeout(function() { selectivity.focus(); }, 1); } selectivity.el = createSelectivityNextToSelectElement($el, options); selectivity.el.selectivity = selectivity; Selectivity.patchEvents($el); bindTraditionalSelectEvents(selectivity); } }); },{"38":38,"jquery":"jquery"}],33:[function(_dereq_,module,exports){ 'use strict'; var Selectivity = _dereq_(38); var findResultItem = _dereq_(40); var getKeyCode = _dereq_(42); var KEY_BACKSPACE = 8; var KEY_DOWN_ARROW = 40; var KEY_ENTER = 13; var KEY_ESCAPE = 27; var KEY_TAB = 9; var KEY_UP_ARROW = 38; /** * Search input listener providing keyboard support for navigating the dropdown. */ function listener(selectivity, input) { var keydownCanceled = false; var closeSubmenu = null; /** * Moves a dropdown's highlight to the next or previous result item. * * @param delta Either 1 to move to the next item, or -1 to move to the previous item. */ function moveHighlight(dropdown, delta) { var results = dropdown.results; if (!results.length) { return; } var resultItems = [].slice.call(dropdown.el.querySelectorAll('.selectivity-result-item')); function scrollToHighlight() { var el; if (dropdown.highlightedResult) { el = findResultItem(resultItems, dropdown.highlightedResult.id); } else if (dropdown.loadMoreHighlighted) { el = dropdown.$('.selectivity-load-more'); } if (el && el.scrollIntoView) { el.scrollIntoView(delta < 0); } } if (dropdown.submenu) { moveHighlight(dropdown.submenu, delta); return; } var defaultIndex = delta > 0 ? 0 : resultItems.length - 1; var index = defaultIndex; var highlightedResult = dropdown.highlightedResult; if (highlightedResult) { var highlightedResultItem = findResultItem(resultItems, highlightedResult.id); index = resultItems.indexOf(highlightedResultItem) + delta; if (delta > 0 ? index >= resultItems.length : index < 0) { if (dropdown.hasMore) { dropdown.highlightLoadMore(); scrollToHighlight(); return; } else { index = defaultIndex; } } } var resultItem = resultItems[index]; var result = Selectivity.findNestedById(results, selectivity.getRelatedItemId(resultItem)); if (result) { dropdown.highlight(result, { delay: !!result.submenu }); scrollToHighlight(); } } function keyHeld(event) { var dropdown = selectivity.dropdown; if (dropdown) { var keyCode = getKeyCode(event); if (keyCode === KEY_BACKSPACE) { if (!input.value) { if (dropdown.submenu) { var submenu = dropdown.submenu; while (submenu.submenu) { submenu = submenu.submenu; } closeSubmenu = submenu; } event.preventDefault(); keydownCanceled = true; } } else if (keyCode === KEY_DOWN_ARROW) { moveHighlight(dropdown, 1); } else if (keyCode === KEY_UP_ARROW) { moveHighlight(dropdown, -1); } else if (keyCode === KEY_TAB) { setTimeout(function() { selectivity.close(); }, 1); } else if (keyCode === KEY_ENTER) { event.preventDefault(); // don't submit forms on keydown } } } function keyReleased(event) { function open() { if (selectivity.options.showDropdown !== false) { selectivity.open(); } } var dropdown = selectivity.dropdown; var keyCode = getKeyCode(event); if (keydownCanceled) { event.preventDefault(); keydownCanceled = false; if (closeSubmenu) { closeSubmenu.close(); selectivity.focus(); closeSubmenu = null; } } else if (keyCode === KEY_BACKSPACE) { if (!dropdown && selectivity.options.allowClear) { selectivity.clear(); } } else if (keyCode === KEY_ENTER && !event.ctrlKey) { if (dropdown) { dropdown.selectHighlight(); } else if (selectivity.options.showDropdown !== false) { open(); } event.preventDefault(); } else if (keyCode === KEY_ESCAPE) { selectivity.close(); event.preventDefault(); } else if (keyCode === KEY_DOWN_ARROW || keyCode === KEY_UP_ARROW) { // handled in keyHeld() because the response feels faster and it works with repeated // events if the user holds the key for a longer period // still, we issue an open() call here in case the dropdown was not yet open... open(); event.preventDefault(); } else { open(); } } input.addEventListener('keydown', keyHeld); input.addEventListener('keyup', keyReleased); } Selectivity.InputListeners.push(listener); },{"38":38,"40":40,"42":42}],34:[function(_dereq_,module,exports){ 'use strict'; var Selectivity = _dereq_(38); var allowedOptions = { allowClear: 'boolean', backspaceHighlightsBeforeDelete: 'boolean', closeOnSelect: 'boolean', createTokenItem: 'function', dropdown: 'function|null', initSelection: 'function|null', inputListeners: 'array', items: 'array|null', matcher: 'function|null', placeholder: 'string', positionDropdown: 'function|null', query: 'function|null', readOnly: 'boolean', removeOnly: 'boolean', shouldOpenSubmenu: 'function', showSearchInputInDropdown: 'boolean', suppressWheelSelector: 'string|null', tabIndex: 'number', templates: 'object', tokenizer: 'function' }; /** * Option listener that validates the options being set. This is useful during debugging to quickly * get notified if you're passing invalid options. */ Selectivity.OptionListeners.unshift(function(selectivity, options) { for (var key in options) { if (!options.hasOwnProperty(key)) { continue; } var value = options[key]; var type = allowedOptions[key]; if ( type && !type.split('|').some(function(type) { if (type === 'null') { return value === null; } else if (type === 'array') { return Array.isArray(value); } else { return value !== null && value !== undefined && typeof value === type; } }) ) { throw new Error(key + ' must be of type ' + type); } } }); },{"38":38}],35:[function(_dereq_,module,exports){ 'use strict'; var Dropdown = _dereq_(22); var Selectivity = _dereq_(38); var findResultItem = _dereq_(40); /** * Extended dropdown that supports submenus. */ function SubmenuPlugin(selectivity, options) { /** * Optional parent dropdown menu from which this dropdown was opened. */ this.parentMenu = options.parentMenu; Dropdown.call(this, selectivity, options); this._closeSubmenuTimeout = 0; this._openSubmenuTimeout = 0; } var callSuper = Selectivity.inherits(SubmenuPlugin, Dropdown, { /** * @inherit */ close: function() { if (this.submenu) { this.submenu.close(); } callSuper(this, 'close'); if (this.parentMenu) { this.parentMenu.submenu = null; this.parentMenu = null; } clearTimeout(this._closeSubmenuTimeout); clearTimeout(this._openSubmenuTimeout); }, /** * @inherit * * @param options Optional options object. May contain the following properties: * delay - If true, indicates any submenu should not be opened until after some * delay. * openSubmenu - If false, no submenu will be automatically opened for the * highlighted item. * reason - The reason why the result item is being highlighted. See * Dropdown#highlight(). */ highlight: function(item, options) { options = options || {}; var reason = options.reason || 'unspecified'; if (options.delay) { callSuper(this, 'highlight', item); clearTimeout(this._openSubmenuTimeout); this._openSubmenuTimeout = setTimeout(this._doHighlight.bind(this, item, reason), 300); } else if (this.submenu) { if (this.highlightedResult && this.highlightedResult.id === item.id) { this._doHighlight(item, reason); } else { clearTimeout(this._closeSubmenuTimeout); this._closeSubmenuTimeout = setTimeout( this._closeSubmenuAndHighlight.bind(this, item, reason), 100 ); } } else { if (this.parentMenu && this.parentMenu._closeSubmenuTimeout) { clearTimeout(this.parentMenu._closeSubmenuTimeout); this.parentMenu._closeSubmenuTimeout = 0; } if (options.openSubmenu === false) { callSuper(this, 'highlight', item); } else { this._doHighlight(item, reason); } } }, /** * @inherit */ search: function(term) { if (this.submenu) { var searchInput = this.$('.selectivity-search-input'); if (searchInput && searchInput === document.activeElement) { this.submenu.close(); } else { this.submenu.search(term); return; } } callSuper(this, 'search', term); }, /** * @inherit */ selectHighlight: function() { if (this.submenu) { this.submenu.selectHighlight(); } else { callSuper(this, 'selectHighlight'); } }, /** * @inherit */ showResults: function(results, options) { // makes sure any result item with a submenu that's not explicitly // set as selectable becomes unselectable function setSelectable(item) { if (item.children) { item.children.forEach(setSelectable); } if (item.submenu) { item.selectable = !!item.selectable; } } if (this.submenu && options.dropdown !== this) { this.submenu.showResults(results, options); } else { results.forEach(setSelectable); callSuper(this, 'showResults', results, options); } }, /** * @inherit */ triggerClose: function() { if (this.parentMenu) { this.selectivity.triggerEvent('selectivity-close-submenu'); } else { callSuper(this, 'triggerClose'); } }, /** * @inherit */ triggerOpen: function() { if (this.parentMenu) { this.selectivity.triggerEvent('selectivity-open-submenu'); } else { callSuper(this, 'triggerOpen'); } }, /** * @private */ _closeSubmenuAndHighlight: function(item, reason) { if (this.submenu) { this.submenu.close(); } this._doHighlight(item, reason); }, /** * @private */ _doHighlight: function(item, reason) { callSuper(this, 'highlight', item); var options = this.selectivity.options; if ( !item.submenu || this.submenu || (options.shouldOpenSubmenu && options.shouldOpenSubmenu(item, reason) === false) ) { return; } var Dropdown = options.dropdown || Selectivity.Dropdown; if (Dropdown) { var resultItems = this.el.querySelectorAll('.selectivity-result-item'); var resultItem = findResultItem(resultItems, item.id); var dropdownEl = this.el; this.submenu = new Dropdown(this.selectivity, { highlightFirstItem: !item.selectable, items: item.submenu.items || null, parentMenu: this, position: function(el, selectEl) { if (item.submenu.positionDropdown) { item.submenu.positionDropdown(el, selectEl, resultItem, dropdownEl); } else { var rect = dropdownEl.getBoundingClientRect(); var left = rect.right; var width = rect.width; if (left + width > document.body.clientWidth && rect.left - width > 0) { // Open the submenu on the left-hand side if there's no sufficient // space on the right side. // Use a little margin to prevent awkward-looking overlaps. left = rect.left - width + 10; } // Move the submenu up so it fits in the window, if necessary and possible. var submenuTop = resultItem.getBoundingClientRect().top; var deltaUp = Math.min( Math.max(submenuTop + el.clientHeight - window.innerHeight, 0), rect.top + rect.height ); el.style.left = left + 'px'; el.style.top = submenuTop - deltaUp + 'px'; el.style.width = width + 'px'; } }, query: item.submenu.query || null, showSearchInput: item.submenu.showSearchInput }); this.submenu.search(''); } } }); Selectivity.Dropdown = SubmenuPlugin; module.exports = SubmenuPlugin; },{"22":22,"38":38,"40":40}],36:[function(_dereq_,module,exports){ 'use strict'; var assign = (window.jQuery || window.Zepto).extend; var Selectivity = _dereq_(38); function defaultTokenizer(input, selection, createToken, options) { var createTokenItem = options.createTokenItem || function(token) { return token ? { id: token, text: token } : null; }; var separators = options.tokenSeparators; function hasToken(input) { return input ? separators.some(function(separator) { return input.indexOf(separator) > -1; }) : false; } function takeToken(input) { for (var i = 0, length = input.length; i < length; i++) { if (separators.indexOf(input[i]) > -1) { return { term: input.slice(0, i), input: input.slice(i + 1) }; } } return {}; } while (hasToken(input)) { var token = takeToken(input); if (token.term) { var item = createTokenItem(token.term); if (item && !Selectivity.findById(selection, item.id)) { createToken(item); } } input = token.input; } return input; } /** * Option listener that provides a default tokenizer which is used when the tokenSeparators option * is specified. * * @param options Options object. In addition to the options supported in the multi-input * implementation, this may contain the following property: * tokenSeparators - Array of string separators which are used to separate the search * string into tokens. If specified and the tokenizer property is * not set, the tokenizer property will be set to a function which * splits the search term into tokens separated by any of the given * separators. The tokens will be converted into selectable items * using the 'createTokenItem' function. The default tokenizer also * filters out already selected items. */ Selectivity.OptionListeners.push(function(selectivity, options) { if (options.tokenSeparators) { options.allowedTypes = assign({ tokenSeparators: 'array' }, options.allowedTypes); options.tokenizer = options.tokenizer || defaultTokenizer; } }); },{"38":38,"lodash/assign":"lodash/assign"}],37:[function(_dereq_,module,exports){ _dereq_(22);_dereq_(24);_dereq_(25);_dereq_(26);_dereq_(27);_dereq_(28);_dereq_(29);_dereq_(30);_dereq_(31);_dereq_(32);_dereq_(33);_dereq_(34);_dereq_(35);_dereq_(36);_dereq_(39);_dereq_(21); },{"21":21,"22":22,"24":24,"25":25,"26":26,"27":27,"28":28,"29":29,"30":30,"31":31,"32":32,"33":33,"34":34,"35":35,"36":36,"39":39}],38:[function(_dereq_,module,exports){ 'use strict'; var assign = (window.jQuery || window.Zepto).extend; var isString = _dereq_(16); var EventListener = _dereq_(23); var toggleClass = _dereq_(47); /** * Selectivity Base Constructor. * * You will never use this constructor directly. Instead, you use $(selector).selectivity(options) * to create an instance of either MultipleSelectivity or SingleSelectivity. This class defines all * functionality that is common between both. * * @param options Options object. Accepts the same options as the setOptions method(), in addition * to the following ones: * data - Initial selection data to set. This should be an array of objects with 'id' * and 'text' properties. This option is mutually exclusive with 'value'. * element - The DOM element to which to attach the Selectivity instance. This * property is set by the API wrapper. * value - Initial value to set. This should be an array of IDs. This property is * mutually exclusive with 'data'. */ function Selectivity(options) { /** * Reference to the currently open dropdown. */ this.dropdown = null; /** * DOM element to which this instance is attached. */ this.el = options.element; /** * Whether the input is enabled. * * This is false when the option readOnly is false or the option removeOnly is false. */ this.enabled = !options.readOnly && !options.removeOnly; /** * DOM element for the input. * * May be null as long as there is no visible input. It is set by initInput(). */ this.input = null; /** * Array of items from which to select. If set, this will be an array of objects with 'id' and * 'text' properties. * * If given, all items are expected to be available locally and all selection operations operate * on this local array only. If null, items are not available locally, and a query function * should be provided to fetch remote data. */ this.items = null; /** * Options passed to the Selectivity instance or set through setOptions(). */ this.options = {}; /** * Mapping of templates. * * Custom templates can be specified in the options object. */ this.templates = assign({}, Selectivity.Templates); /** * The last used search term. */ this.term = ''; this.setOptions(options); if (options.value) { this.setValue(options.value, { triggerChange: false }); } else { this.setData(options.data || null, { triggerChange: false }); } this.el.setAttribute('tabindex', options.tabIndex || 0); this.events = new EventListener(this.el, this); this.events.on({ blur: this._blur, mouseenter: this._mouseenter, mouseleave: this._mouseleave, 'selectivity-close': this._closed }); } /** * Methods. */ assign(Selectivity.prototype, { /** * Convenience shortcut for this.el.querySelector(selector). */ $: function(selector) { return this.el.querySelector(selector); }, /** * Closes the dropdown. */ close: function() { this._clearCloseTimeout(); if (this.dropdown) { this.dropdown.close(); this.dropdown = null; } }, /** * Destroys the Selectivity instance. */ destroy: function() { this.events.destruct(); var el = this.el; while (el.firstChild) { el.removeChild(el.firstChild); } el.selectivity = null; }, /** * Filters the results to be displayed in the dropdown. * * The default implementation simply returns the results unfiltered, but the MultipleSelectivity * class overrides this method to filter out any items that have already been selected. * * @param results Array of items with 'id' and 'text' properties. * * @return The filtered array. */ filterResults: function(results) { return results; }, /** * Applies focus to the input. */ focus: function() { this._clearCloseTimeout(); this._focusing = true; if (this.input) { this.input.focus(); } this._focusing = false; }, /** * Returns the selection data. */ getData: function() { return this._data; }, /** * Returns the correct item for a given ID. * * @param id The ID to get the item for. * * @return The corresponding item. Will be an object with 'id' and 'text' properties or null if * the item cannot be found. Note that if no items are defined, this method assumes the * text labels will be equal to the IDs. */ getItemForId: function(id) { var items = this.items; if (items) { return Selectivity.findNestedById(items, id); } else if (id === null) { return null; } else { return { id: id, text: '' + id }; } }, /** * Returns the item ID related to an element or event target. * * @param elementOrEvent The DOM element or event to get the item ID for. * * @return Item ID or null if no ID could be found. */ getRelatedItemId: function(elementOrEvent) { var el = elementOrEvent.target || elementOrEvent; while (el) { if (el.hasAttribute('data-item-id')) { break; } el = el.parentNode; } if (!el) { return null; } var id = el.getAttribute('data-item-id'); // IDs can be either numbers or strings, but attribute values are always strings, so we // will have to find out whether the item ID ought to be a number or string ourselves. if (Selectivity.findById(this._data || [], id)) { return id; } else { var dropdown = this.dropdown; while (dropdown) { if (Selectivity.findNestedById(dropdown.results, id)) { return id; } // FIXME: reference to submenu plugin doesn't belong in base dropdown = dropdown.submenu; } var number = parseInt(id, 10); return '' + number === id ? number : id; } }, /** * Returns the value of the selection. */ getValue: function() { return this._value; }, /** * Initializes the input element. * * Sets the input property, invokes all input listeners and (by default) attaches the action of * searching when something is typed. * * @param input Input element. * @param options Optional options object. May contain the following property: * search - If false, no event handlers are setup to initiate searching when the * user types in the input field. This is useful if you want to use the * input only to handle keyboard support. */ initInput: function(input, options) { this.input = input; var selectivity = this; var inputListeners = this.options.inputListeners || Selectivity.InputListeners; inputListeners.forEach(function(listener) { listener(selectivity, input, options); }); if (!options || options.search !== false) { input.addEventListener('keyup', function(event) { if (!event.defaultPrevented) { selectivity.search(event.target.value); } }); } }, /** * Opens the dropdown. */ open: function() { if (this._opening || this.dropdown || !this.triggerEvent('selectivity-opening')) { return; } this._opening = true; var Dropdown = this.options.dropdown || Selectivity.Dropdown; if (Dropdown) { this.dropdown = new Dropdown(this, { items: this.items, position: this.options.positionDropdown, query: this.options.query, showSearchInput: this.options.showSearchInputInDropdown !== false }); } this.search(''); this.focus(); toggleClass(this.el, 'open', true); this._opening = false; }, /** * (Re-)positions the dropdown. */ positionDropdown: function() { if (this.dropdown) { this.dropdown.position(); } }, /** * Searches for results based on the term given. * * If an items array has been passed with the options to the Selectivity instance, a local * search will be performed among those items. Otherwise, the query function specified in the * options will be used to perform the search. If neither is defined, nothing happens. * * @param term Term to search for. */ search: function(term) { this.open(); if (this.dropdown) { this.dropdown.search(term); } }, /** * Sets the selection data. * * The selection data contains both IDs and text labels. If you only want to set or get the IDs, * you should use the value() method. * * @param newData New data to set. For a MultipleSelectivity instance the data must be an array * of objects with 'id' and 'text' properties, for a SingleSelectivity instance * the data must be a single such object or null to indicate no item is selected. * @param options Optional options object. May contain the following property: * triggerChange - Set to false to suppress the "change" event being triggered. * Note this will also cause the UI to not update automatically; * so you may want to call rerenderSelection() manually when * using this option. */ setData: function(newData, options) { options = options || {}; newData = this.validateData(newData); this._data = newData; this._value = this.getValueForData(newData); if (options.triggerChange !== false) { this.triggerChange(); } }, /** * Sets one or more options on this Selectivity instance. * * @param options Options object. May contain one or more of the following properties: * closeOnSelect - Set to false to keep the dropdown open after the user has * selected an item. This is useful if you want to allow the user * to quickly select multiple items. The default value is true. * dropdown - Custom dropdown implementation to use for this instance. * initSelection - Function to map values by ID to selection data. This function * receives two arguments, 'value' and 'callback'. The value is * the current value of the selection, which is an ID or an array * of IDs depending on the input type. The callback should be * invoked with an object or array of objects, respectively, * containing 'id' and 'text' properties. * inputListeners - Array of search input listeners. By default, the global * array Selectivity.InputListeners is used. * items - Array of items from which to select. Should be an array of objects * with 'id' and 'text' properties. As convenience, you may also pass an * array of strings, in which case the same string is used for both the * 'id' and 'text' properties. If items are given, all items are expected * to be available locally and all selection operations operate on this * local array only. If null, items are not available locally, and a * query function should be provided to fetch remote data. * matcher - Function to determine whether text matches a given search term. Note * this function is only used if you have specified an array of items. * Receives two arguments: * item - The item that should match the search term. * term - The search term. Note that for performance reasons, the term * has always been already processed using * Selectivity.transformText(). * The method should return the item if it matches, and null otherwise. * If the item has a children array, the matcher is expected to filter * those itself (be sure to only return the filtered array of children * in the returned item and not to modify the children of the item * argument). * placeholder - Placeholder text to display when the element has no focus and * no selected items. * positionDropdown - Function to position the dropdown. Receives two arguments: * dropdownEl - The element to be positioned. * selectEl - The element of the Selectivity instance, that * you can position the dropdown to. * The default implementation positions the dropdown element * under the Selectivity's element and gives it the same * width. * query - Function to use for querying items. Receives a single object as * argument with the following properties: * callback - Callback to invoke when the results are available. This * callback should be passed a single object as argument with * the following properties: * more - Boolean that can be set to true to indicate there * are more results available. Additional results may * be fetched by the user through pagination. * results - Array of result items. The format for the result * items is the same as for passing local items. * offset - This property is only used for pagination and indicates how * many results should be skipped when returning more results. * selectivity - The Selectivity instance the query function is used on. * term - The search term the user is searching for. Unlike with the * matcher function, the term has not been processed using * Selectivity.transformText(). * readOnly - If true, disables any modification of the input. * removeOnly - If true, disables any modification of the input except removing * of selected items. * shouldOpenSubmenu - Function to call that will decide whether a submenu should * be opened. Receives two parameters: * item - The currently highlighted result item. * reason - The reason why the item is being highlighted. * See Dropdown#highlight() for possible values. * showDropdown - Set to false if you don't want to use any dropdown (you can * still open it programmatically using open()). * showSearchInputInDropdown - Set to false to remove the search input used in * dropdowns. The default is true for single-value * inputs. * templates - Object with instance-specific templates to override the global * templates assigned to Selectivity.Templates. */ setOptions: function(options) { options = options || {}; var selectivity = this; Selectivity.OptionListeners.forEach(function(listener) { listener(selectivity, options); }); if ('items' in options) { this.items = options.items ? Selectivity.processItems(options.items) : null; } if ('templates' in options) { assign(this.templates, options.templates); } assign(this.options, options); this.enabled = !this.options.readOnly && !this.options.removeOnly; }, /** * Sets the value of the selection. * * The value of the selection only concerns the IDs of the selection items. If you are * interested in the IDs and the text labels, you should use the data() method. * * Note that if neither the items option nor the initSelection option have been set, Selectivity * will have no way to determine what text labels should be used with the given IDs in which * case it will assume the text is equal to the ID. This is useful if you're working with tags, * or selecting e-mail addresses for instance, but may not always be what you want. * * @param newValue New value to set. For a MultipleSelectivity instance the value must be an * array of IDs, for a SingleSelectivity instance the value must be a single ID * (a string or a number) or null to indicate no item is selected. * @param options Optional options object. May contain the following property: * triggerChange - Set to false to suppress the "change" event being triggered. * Note this will also cause the UI to not update automatically; * so you may want to call rerenderSelection() manually when * using this option. */ setValue: function(newValue, options) { options = options || {}; newValue = this.validateValue(newValue); this._value = newValue; if (this.options.initSelection) { this.options.initSelection( newValue, function(data) { if (this._value === newValue) { this._data = this.validateData(data); if (options.triggerChange !== false) { this.triggerChange(); } } }.bind(this) ); } else { this._data = this.getDataForValue(newValue); if (options.triggerChange !== false) { this.triggerChange(); } } }, /** * Returns the result of the given template. * * @param templateName Name of the template to process. * @param options Options to pass to the template. * * @return String containing HTML or ReactElement if template is a function returning * ReactElement. */ template: function(templateName, options) { var template = this.templates[templateName]; if (!template) { throw new Error('Unknown template: ' + templateName); } if (typeof template === 'function') { var templateResult = template(options); return typeof templateResult === 'string' ? templateResult.trim() : templateResult; } else if (template.render) { return template.render(options).trim(); } else { return template.toString().trim(); } }, /** * Triggers the change event. * * The event object at least contains the following properties: * data - The new data of the Selectivity instance. * value - The new value of the Selectivity instance. * * @param Optional additional options added to the event object. * * @see getData() * @see getValue() */ triggerChange: function(options) { var data = assign({ data: this._data, value: this._value }, options); this.triggerEvent('change', data); this.triggerEvent('selectivity-change', data); }, /** * Triggers an event on the instance's element. * * @param eventName Name of the event to trigger. * @param data Optional event data to be added to the event object. * * @return Whether the default action of the event may be executed, ie. returns false if * preventDefault() has been called. */ triggerEvent: function(eventName, data) { var event = document.createEvent('Event'); event.initEvent(eventName, /* bubbles: */ false, /* cancelable: */ true); assign(event, data); this.el.dispatchEvent(event); return !event.defaultPrevented; }, /** * Validates a single item. Throws an exception if the item is invalid. * * @param item The item to validate. * * @return The validated item. May differ from the input item. */ validateItem: function(item) { if (item && Selectivity.isValidId(item.id) && isString(item.text)) { return item; } else { throw new Error('Item should have id (number or string) and text (string) properties'); } }, /** * @private */ _blur: function() { if (!this._focusing && !this.el.classList.contains('hover')) { // Without the timeout it appears clicks on result items are not always properly // handled, especially when the user doesn't click exactly on the text of the result // item. I don't understand really why that happens, or why the timeout has to be so // large, but after trial and error, this now seems to work reliably... this._clearCloseTimeout(); this._closeTimeout = setTimeout(this.close.bind(this), 166); } }, /** * @private */ _clearCloseTimeout: function() { if (this._closeTimeout) { clearTimeout(this._closeTimeout); this._closeTimeout = 0; } }, /** * @private */ _closed: function() { this.dropdown = null; toggleClass(this.el, 'open', false); }, /** * @private */ _mouseleave: function(event) { // If mouseleave happens on any selectivity related element, remove hover class if (!this.el.contains(event.relatedTarget)) { toggleClass(this.el, 'hover', false); } }, /** * @private */ _mouseenter: function() { toggleClass(this.el, 'hover', true); } }); /** * Dropdown class to use for displaying dropdowns. * * The default implementation of a dropdown is defined in the selectivity-dropdown module. */ Selectivity.Dropdown = null; /** * Array of input listeners. * * Input listeners are invoked when initInput() is called (typically right after the input is * created). Every listener receives three arguments: * * selectivity - The Selectivity instance. * input - DOM element of the input. * options - Options that were passed to initInput(). * * An example of a search input listener is the selectivity-keyboard module. */ Selectivity.InputListeners = []; /** * Mapping of input types. */ Selectivity.Inputs = {}; /** * Array of option listeners. * * Option listeners are invoked when setOptions() is called. Every listener receives two arguments: * * selectivity - The Selectivity instance. * options - The options that are about to be set. The listener may modify this options object. * * An example of an option listener is the selectivity-traditional module. */ Selectivity.OptionListeners = []; /** * Mapping with templates to use for rendering select boxes and dropdowns. See * selectivity-templates.js for a useful set of default templates, as well as for documentation of * the individual templates. */ Selectivity.Templates = {}; /** * Finds an item in the given array with the specified ID. * * @param array Array to search in. * @param id ID to search for. * * @return The item in the array with the given ID, or null if the item was not found. */ Selectivity.findById = function(array, id) { var index = Selectivity.findIndexById(array, id); return index > -1 ? array[index] : null; }; /** * Finds the index of an item in the given array with the specified ID. * * @param array Array to search in. * @param id ID to search for. * * @return The index of the item in the array with the given ID, or -1 if the item was not found. */ Selectivity.findIndexById = function(array, id) { for (var i = 0, length = array.length; i < length; i++) { if (array[i].id === id) { return i; } } return -1; }; /** * Finds an item in the given array with the specified ID. Items in the array may contain 'children' * properties which in turn will be searched for the item. * * @param array Array to search in. * @param id ID to search for. * * @return The item in the array with the given ID, or null if the item was not found. */ Selectivity.findNestedById = function(array, id) { for (var i = 0, length = array.length; i < length; i++) { var item = array[i], result; if (item.id === id) { result = item; } else if (item.children) { result = Selectivity.findNestedById(item.children, id); } else if (item.submenu && item.submenu.items) { // FIXME: reference to submenu plugin doesn't belong in base result = Selectivity.findNestedById(item.submenu.items, id); } if (result) { return result; } } return null; }; /** * Utility method for inheriting another class. * * @param SubClass Constructor function of the subclass. * @param SuperClass Constructor function of the superclass. * @param prototype Object with methods you want to add to the subclass prototype. * * @return A utility function for calling the methods of the superclass. This function receives two * arguments: The this object on which you want to execute the method and the name of the * method. Any arguments past those are passed to the superclass method. */ Selectivity.inherits = function(SubClass, SuperClass, prototype) { SubClass.prototype = assign( Object.create(SuperClass.prototype), { constructor: SubClass }, prototype ); return function(self, methodName) { SuperClass.prototype[methodName].apply(self, Array.prototype.slice.call(arguments, 2)); }; }; /** * Checks whether a value can be used as a valid ID for selection items. Only numbers and strings * are accepted to be used as IDs. * * @param id The value to check whether it is a valid ID. * * @return true if the value is a valid ID, false otherwise. */ Selectivity.isValidId = function(id) { return typeof id === 'number' || isString(id); }; /** * Decides whether a given item matches a search term. The default implementation simply * checks whether the term is contained within the item's text, after transforming them using * transformText(). * * @param item The item that should match the search term. * @param term The search term. Note that for performance reasons, the term has always been already * processed using transformText(). * * @return true if the text matches the term, false otherwise. */ Selectivity.matcher = function(item, term) { var result = null; if (Selectivity.transformText(item.text).indexOf(term) > -1) { result = item; } else if (item.children) { var matchingChildren = item.children .map(function(child) { return Selectivity.matcher(child, term); }) .filter(function(child) { return !!child; }); if (matchingChildren.length) { result = { id: item.id, text: item.text, children: matchingChildren }; } } return result; }; /** * Helper function for processing items. * * @param item The item to process, either as object containing 'id' and 'text' properties or just * as ID. The 'id' property of an item is optional if it has a 'children' property * containing an array of items. * * @return Object containing 'id' and 'text' properties. */ Selectivity.processItem = function(item) { if (Selectivity.isValidId(item)) { return { id: item, text: '' + item }; } else if (item && (Selectivity.isValidId(item.id) || item.children) && isString(item.text)) { if (item.children) { item.children = Selectivity.processItems(item.children); } return item; } else { throw new Error('invalid item'); } }; /** * Helper function for processing an array of items. * * @param items Array of items to process. See processItem() for details about a single item. * * @return Array with items. */ Selectivity.processItems = function(items) { if (Array.isArray(items)) { return items.map(Selectivity.processItem); } else { throw new Error('invalid items'); } }; /** * Transforms text in order to find matches. The default implementation casts all strings to * lower-case so that any matches found will be case-insensitive. * * @param string The string to transform. * * @return The transformed string. */ Selectivity.transformText = function(string) { return string.toLowerCase(); }; module.exports = Selectivity; },{"16":16,"23":23,"47":47,"lodash/assign":"lodash/assign"}],39:[function(_dereq_,module,exports){ 'use strict'; var escape = _dereq_(12); var Selectivity = _dereq_(38); var Locale = _dereq_(27); /** * Default set of templates to use with Selectivity.js. * * Template can be defined as either a string, a function returning a string (like Handlebars * templates, for instance), an object containing a render function (like Hogan.js templates, fo * instance) or as a function returning a DOM element. * * Every template must return a single root element. */ Selectivity.Templates = { /** * Renders the dropdown. * * The template is expected to have at least one element with the class * 'selectivity-results-container', which is where all results will be added to. * * @param options Options object containing the following properties: * dropdownCssClass - Optional CSS class to add to the top-level element. * searchInputPlaceholder - Optional placeholder text to display in the search * input in the dropdown. * showSearchInput - Boolean whether a search input should be shown. If true, * an input element with the 'selectivity-search-input' is * expected. */ dropdown: function(options) { var extraClass = options.dropdownCssClass ? ' ' + options.dropdownCssClass : '', searchInput = ''; if (options.showSearchInput) { extraClass += ' has-search-input'; var placeholder = options.searchInputPlaceholder; searchInput = '
    ' + '' + '
    '; } return ( '
    ' + searchInput + '
    ' + '
    ' ); }, /** * Renders an error message in the dropdown. * * @param options Options object containing the following properties: * escape - Boolean whether the message should be HTML-escaped. * message - The message to display. */ error: function(options) { return ( '
    ' + (options.escape ? escape(options.message) : options.message) + '
    ' ); }, /** * Renders a loading indicator in the dropdown. * * This template is expected to have an element with a 'selectivity-loading' class which may be * replaced with actual results. */ loading: function() { return '
    ' + Locale.loading + '
    '; }, /** * Load more indicator. * * This template is expected to have an element with a 'selectivity-load-more' class which, when * clicked, will load more results. */ loadMore: function() { return '
    ' + Locale.loadMore + '
    '; }, /** * Renders multi-selection input boxes. * * The template is expected to have at least have elements with the following classes: * 'selectivity-multiple-input-container' - The element containing all the selected items and * the input for selecting additional items. * 'selectivity-multiple-input' - The actual input element that allows the user to type to * search for more items. When selected items are added, they are * inserted right before this element. * * @param options Options object containing the following property: * enabled - Boolean whether the input is enabled. */ multipleSelectInput: function(options) { return ( '
    ' + (options.enabled ? '' : '
    ') + '
    ' + '
    ' ); }, /** * Renders a selected item in multi-selection input boxes. * * The template is expected to have a top-level element with the class * 'selectivity-multiple-selected-item'. This element is also required to have a 'data-item-id' * attribute with the ID set to that passed through the options object. * * An element with the class 'selectivity-multiple-selected-item-remove' should be present * which, when clicked, will cause the element to be removed. * * @param options Options object containing the following properties: * highlighted - Boolean whether this item is currently highlighted. * id - Identifier for the item. * removable - Boolean whether a remove icon should be displayed. * text - Text label which the user sees. */ multipleSelectedItem: function(options) { var extraClass = options.highlighted ? ' highlighted' : ''; return ( '' + (options.removable ? '' + '' + '' : '') + escape(options.text) + '' ); }, /** * Renders a message there are no results for the given query. * * @param options Options object containing the following property: * term - Search term the user is searching for. */ noResults: function(options) { return ( '
    ' + (options.term ? Locale.noResultsForTerm(options.term) : Locale.noResults) + '
    ' ); }, /** * Renders a container for item children. * * The template is expected to have an element with the class 'selectivity-result-children'. * * @param options Options object containing the following property: * childrenHtml - Rendered HTML for the children. */ resultChildren: function(options) { return '
    ' + options.childrenHtml + '
    '; }, /** * Render a result item in the dropdown. * * The template is expected to have a top-level element with the class * 'selectivity-result-item'. This element is also required to have a 'data-item-id' attribute * with the ID set to that passed through the options object. * * @param options Options object containing the following properties: * id - Identifier for the item. * text - Text label which the user sees. * disabled - Truthy if the item should be disabled. * submenu - Truthy if the result item has a menu with subresults. */ resultItem: function(options) { return ( '
    ' + escape(options.text) + (options.submenu ? '' : '') + '
    ' ); }, /** * Render a result label in the dropdown. * * The template is expected to have a top-level element with the class * 'selectivity-result-label'. * * @param options Options object containing the following properties: * text - Text label. */ resultLabel: function(options) { return '
    ' + escape(options.text) + '
    '; }, /** * Renders single-select input boxes. * * The template is expected to have at least one element with the class * 'selectivity-single-result-container' which is the element containing the selected item or * the placeholder. */ singleSelectInput: function(options) { return ( '
    ' + '' + '
    ' + '' + '
    ' ); }, /** * Renders the placeholder for single-select input boxes. * * The template is expected to have a top-level element with the class * 'selectivity-placeholder'. * * @param options Options object containing the following property: * placeholder - The placeholder text. */ singleSelectPlaceholder: function(options) { return '
    ' + escape(options.placeholder) + '
    '; }, /** * Renders the selected item in single-select input boxes. * * The template is expected to have a top-level element with the class * 'selectivity-single-selected-item'. This element is also required to have a 'data-item-id' * attribute with the ID set to that passed through the options object. * * @param options Options object containing the following properties: * id - Identifier for the item. * removable - Boolean whether a remove icon should be displayed. * text - Text label which the user sees. */ singleSelectedItem: function(options) { return ( '' + (options.removable ? '' + '' + '' : '') + escape(options.text) + '' ); }, /** * Renders select-box inside single-select input that was initialized on * traditional element. * mode - Mode in which select exists, single or multiple. */ selectCompliance: function(options) { var mode = options.mode; var name = options.name; if (mode === 'multiple' && name.slice(-2) !== '[]') { name += '[]'; } return ( '' ); }, /** * Renders the selected item in compliance
    "}return'
    '+i+'
    '},error:function(t){return'
    '+(t.escape?n(t.message):t.message)+"
    "},loading:function(){return'
    '+r.loading+"
    "},loadMore:function(){return'
    '+r.loadMore+"
    "},multipleSelectInput:function(t){return'
    '+(t.enabled?'':'
    ')+'
    '},multipleSelectedItem:function(t){return''+(t.removable?'':"")+n(t.text)+""},noResults:function(t){return'
    '+(t.term?r.noResultsForTerm(t.term):r.noResults)+"
    "},resultChildren:function(t){return'
    '+t.childrenHtml+"
    "},resultItem:function(t){return'
    '+n(t.text)+(t.submenu?'':"")+"
    "},resultLabel:function(t){return'
    '+n(t.text)+"
    "},singleSelectInput:function(t){return'
    '},singleSelectPlaceholder:function(t){return'
    '+n(t.placeholder)+"
    "},singleSelectedItem:function(t){return''+(t.removable?'':"")+n(t.text)+""},selectCompliance:function(t){var e=t.mode,i=t.name;return"multiple"===e&&"[]"!==i.slice(-2)&&(i+="[]"),'"},selectOptionCompliance:function(t){return'"}}},{12:12,27:27,37:37}],39:[function(t,e,i){"use strict";e.exports=function(t,e){for(var i=0,n=t.length;i` elements. The React API's `onChange` property uses the new event. - Rewrote the AJAX plugin: - It now relies on the `fetch()` method for performing AJAX requests. This method is only available on modern browsers, so you'll need a polyfill if you want to use this with old browsers, unless you're using a jQuery build in which case the `jquery/ajax` plugin can provide a shim based on `$.ajax()` (requires jQuery 3.0 or higher). - Please check the documentation for the new options that can be passed. - Renamed the option `suppressMouseWheelSelector` to just `suppressWheelSelector`. - Renamed the `Selectivity.InputTypes` map to `Selectivity.Inputs`. - Removed dist directory from the repository. - Improved submenu positioning by automatically opening them on the left-hand side if there's insufficient space on the right side. - Improve searching behavior with multiple submenus open. - Fix #107: Remove the dropdown after timeout to fix "hover" behavior. - Fix #136: Update original `` element now uses "s9y\_" prefix for its ID (thanks to @dr-itz). - Fix: Provide correct offset in pagination when results are filtered. ## 2.1.0 - Implemented `disabled` property on items. When an item is disabled it cannot be selected and by default is rendered with grey text. - PR #63: Fix problem with `closeOnSelect` behavior. - PR #80: Added CSS classes for `hover` and `open` states. - Fix #66: Respect `removeOnly` option when set after initialization. - Fix #67: Pass `queryOptions` to `url` function in AJAX module. - Fix #75: Make sure Enter key doesn't submit forms. - Fix #93: Make the rerenderSelection() method public and document that `triggerChange: false` doesn't automatically update the UI. - Fixed issue where the cursor position was constantly reset when using a tokenizer. - Miscellaneous smaller fixes and styling tweaks. ## 2.0.0 images/handle.png000064400000000313146726725200007762 0ustar00PNG  IHDR 2ϽsBIT|d pHYs  ~tEXtCreation Time14.10.4u3tEXtSoftwareAdobe Fireworks CS6輲$IDATc SCF_Config::NAME, 'posts_per_page' => -1, 'post_status' => 'any', ) ); foreach ( $cf_posts as $post ) { wp_delete_post( $post->ID, true ); } delete_post_meta_by_key( SCF_Config::PREFIX . 'repeat-multiple-data' ); // option の smart-cf-xxx を削除 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching global $wpdb; $wpdb->query( $wpdb->prepare( " DELETE FROM $wpdb->options WHERE option_name LIKE %s ", SCF_Config::PREFIX . '%' ) ); // phpcs:enable } /** * Run management screens. * * @param WP_Screen $screen Current WP_Screen object. */ public function current_screen( $screen ) { // 一覧画面 if ( 'edit-' . SCF_Config::NAME === $screen->id ) { return; } // 新規作成・編集画面 if ( SCF_Config::NAME === $screen->id ) { require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.settings.php'; new Smart_Custom_Fields_Controller_Settings(); return; } // その他の新規作成・編集画面 if ( in_array( $screen->id, get_post_types(), true ) ) { $post_id = $this->get_post_id_in_admin(); if ( SCF::get_settings( SCF::generate_post_object( $post_id, $screen->id ) ) ) { require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.controller-base.php'; require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.editor.php'; new Smart_Custom_Fields_Revisions(); new Smart_Custom_Fields_Controller_Editor(); } return; } // プロフィール編集画面 if ( in_array( $screen->id, array( 'profile', 'user-edit' ), true ) ) { $user_id = $this->get_user_id_in_admin(); if ( SCF::get_settings( get_userdata( $user_id ) ) ) { require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.controller-base.php'; require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.profile.php'; new Smart_Custom_Fields_Controller_Profile(); } return; } // タグ、カテゴリー、タクソノミー if ( $screen->taxonomy ) { $term_id = $this->get_term_id_in_admin(); if ( $term_id ) { $term = get_term( $term_id, $screen->taxonomy ); if ( SCF::get_settings( $term ) ) { require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.controller-base.php'; require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.taxonomy.php'; new Smart_Custom_Fields_Controller_Taxonomy(); } } return; } // オプションページ $menu_slug = preg_replace( '/^toplevel_page_(.+)$/', '$1', $screen->id ); $options_pages = SCF::get_options_pages(); if ( array_key_exists( $menu_slug, $options_pages ) ) { $option = SCF::generate_option_object( $menu_slug ); if ( SCF::get_settings( $option ) ) { require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.controller-base.php'; require_once plugin_dir_path( __FILE__ ) . 'classes/controller/class.option.php'; new Smart_Custom_Fields_Controller_Option(); } } } /** * Registering custom post type. * Run the menu display in a different method. */ public function register_post_type() { $labels = array( 'name' => __( 'Smart Custom Fields', 'smart-custom-fields' ), 'menu_name' => __( 'Smart Custom Fields', 'smart-custom-fields' ), 'name_admin_bar' => __( 'Smart Custom Fields', 'smart-custom-fields' ), 'add_new' => __( 'Add New', 'smart-custom-fields' ), 'add_new_item' => __( 'Add New', 'smart-custom-fields' ), 'new_item' => __( 'New Field', 'smart-custom-fields' ), 'edit_item' => __( 'Edit Field', 'smart-custom-fields' ), 'view_item' => __( 'View Field', 'smart-custom-fields' ), 'all_items' => __( 'All Fields', 'smart-custom-fields' ), 'search_items' => __( 'Search Fields', 'smart-custom-fields' ), 'parent_item_colon' => __( 'Parent Fields:', 'smart-custom-fields' ), 'not_found' => __( 'No Fields found.', 'smart-custom-fields' ), 'not_found_in_trash' => __( 'No Fields found in Trash.', 'smart-custom-fields' ), ); register_post_type( SCF_Config::NAME, array( 'label' => 'Smart Custom Fields', 'labels' => $labels, 'public' => false, 'show_ui' => true, 'capability_type' => 'page', 'supports' => array( 'title', 'page-attributes' ), 'show_in_menu' => false, ) ); } /** * Hooking the process that it want to fire when the ajax request. */ public function ajax_request() { new Smart_Custom_Fields_Ajax(); } /** * Adding menus in management screen. */ public function admin_menu() { add_menu_page( 'Smart Custom Fields', 'Smart Custom Fields', 'manage_options', 'edit.php?post_type=' . SCF_Config::NAME, false, false, '80.026' ); add_submenu_page( 'edit.php?post_type=' . SCF_Config::NAME, __( 'Add New', 'smart-custom-fields' ), __( 'Add New', 'smart-custom-fields' ), 'manage_options', 'post-new.php?post_type=' . SCF_Config::NAME ); } /** * Getting the post ID in post editing page. * * @return int */ protected function get_post_id_in_admin() { $post_id = false; $_post = filter_input( INPUT_GET, 'post' ); if ( ! empty( $_post ) ) { $post_id = $_post; } $_post_id = filter_input( INPUT_POST, 'post_ID' ); if ( ! empty( $_post_id ) ) { $post_id = $_post_id; } return $post_id; } /** * Getting the user ID in profile and user editing pages. * * @return int */ protected function get_user_id_in_admin() { $screen = get_current_screen(); $user_id = false; $_user_id = filter_input( INPUT_GET, 'user_id' ); if ( ! empty( $_user_id ) ) { $user_id = $_user_id; } $_user_id = filter_input( INPUT_POST, 'user_id' ); if ( ! empty( $_user_id ) ) { $user_id = $_user_id; } if ( 'profile' === $screen->id ) { $current_user = wp_get_current_user(); $user_id = $current_user->ID; } return $user_id; } /** * Getting the term ID in term editing page. * * @return int */ protected function get_term_id_in_admin() { $term_id = false; $tag_id = filter_input( INPUT_GET, 'tag_ID' ); if ( ! empty( $tag_id ) ) { $term_id = $tag_id; } $tag_id = filter_input( INPUT_POST, 'tag_ID' ); if ( ! empty( $tag_id ) ) { $term_id = $tag_id; } return $term_id; } } new Smart_Custom_Fields();