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 | |
function prefix_get_first_attachment( $post ) { | |
$attachment = get_children( | |
array( | |
'post_parent' => $post->ID, | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'order' => 'DESC', | |
'numberposts' => 1, | |
) |
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 | |
//Change error message of AJAX submitted form. | |
add_filter( 'caldera_forms_render_notices', function( $notices ){ | |
//Will NOT be set (during AJAX return) if there is no error | |
if( isset( $notices[ 'error' ], $notices[ 'error' ][ 'note' ] ) ){ | |
$notices[ 'error' ][ 'note' ] = 'Form could not be submitted, please correct erorrs or give us a call.'; | |
} | |
return $notices; | |
}); |
OlderNewer