This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"0":{"title":"Vertical Alignment","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":"","width":"full","location":"inline","conditionalLogic":null,"id":"submit","layoutGridColumnSpan":3},"fields":[{"type":"address","id":8,"formId":153,"label":"Address","adminLabel":"","isRequired":false,"size":"large","errorMessage":"","visibility":"visible","addressType":"international","inputs":[{"id":"8.1","label":"Street Address","name":"","autocompleteAttribute":"address-line1"},{"id":"8.2","label":"Address Line 2","name":"","autocompleteAttribute":"address-line2"},{"id":"8.3","label":"City","name":"","autocompleteAttribute":"address-level2"},{"id":"8.4","label":"State \/ Province","name":"","autocompleteAttribute":"address-level1"},{"id":"8.5","label":"ZIP \/ Postal Code","name":"","autocompleteAttribute":"postal-code"},{"id":"8.6","label":"Country","name":"","autocompleteAttribute":"country-name"}],"description":"","allowsPrepopulate":false," |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'gform_form_settings_fields', function( $fields ) { | |
| $test_group = [ | |
| [ | |
| 'title' => 'Example Fields', | |
| 'fields' => [ | |
| [ | |
| 'name' => 'input', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Temporary test fields - will be deleted before merge | |
| array( | |
| 'title' => esc_html__( 'Test all the fields', 'gravityforms' ), | |
| 'fields' => array( | |
| array( | |
| 'name' => 'text', | |
| 'type' => 'text', | |
| 'label' => 'Text', | |
| 'description' => 'Here is a description of this text field.', | |
| 'feedback_callback' => function( $field, $value ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"0":{"title":"#16 autocomplete","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"text","id":1,"label":"Single Line Text","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":15,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":"","autocompleteAttribute":"given-name, name","enableAutocomplete":true,"layoutGroupId":"f294117d"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add the Color Options section to the customizer | |
| * | |
| * @param $wp_customize | |
| */ | |
| function cgs_color_options_section( $wp_customize ) { | |
| $wp_customize->add_section( | |
| 'cgs_color_options', | |
| array( | |
| 'title' => esc_html__( 'Theme Color Scheme', 'cgs' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'wpaesm_single_shift_cell', 'corne768709_show_clockin_clockout', 10, 4 ); | |
| function corne768709_show_clockin_clockout( $shift_text, $priority, $shift_id, $employee ) { | |
| $clock_times = 'Worked: '; | |
| $clockin = get_post_meta( $shift_id, '_wpaesm_clockin', true ); | |
| if( '' !== $clockin ) { | |
| $clock_times .= $clockin; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'the_content', 'asdf_only_employees_see_shifts' ); | |
| function asdf_only_employees_see_shifts( $content ) { | |
| if( is_singular( 'shift' ) && is_main_query() && !is_admin() ) { | |
| $current_user = get_current_user_id(); | |
| $users = get_users( array( | |
| 'connected_type' => 'shifts_to_employees', | |
| 'connected_items' => get_the_id(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'the_content', 'fireresource_show_available_employees' ); | |
| function fireresource_show_available_employees( $content ) { | |
| if( is_singular( 'shift' ) && is_main_query() && !is_admin() ) { | |
| $available_employees = get_post_meta( get_the_id(), '_wpaesm_shiftnotes', true ); | |
| if( $available_employees ) { | |
| $new_content = '<p><strong>Available Employees:</strong>' . $available_employees . '</p>'; | |
| } | |
| $content = $new_content . $content; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Scheduled Action Hook | |
| function employee_scheduler_check_for_reminder( ) { | |
| // get tomorrow's date in the correct format | |
| $tomorrow = date( 'F j, Y', strtotime( '+1 day', date() ) ); | |
| // find all shifts scheduled for tomorrow | |
| $args = array( | |
| 'post_type' => 'shift', | |
| 'meta_query' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * At the end of every blockquote, include a link to tweet the quote | |
| * | |
| * @param $content | |
| * | |
| * @return mixed | |
| */ | |
| function myprefix_add_twitter_link_to_blockquote( $content ) { | |
| $content = preg_replace( '#(<blockquote><p>)(.*)(</p></blockquote>)#m', '$1 $2 <a href="http://twitter.com/intent/tweet?status=$2 via @twitterusername ' . get_the_permalink() . '" class="genericon genericon-twitter" target="_blank">Tweet This</a> $3', $content ); |