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( 'ninja_forms_render_options', 'my_ninja_forms_render_options', 10, 2 ); | |
| function my_ninja_forms_render_options( $options, $settings ){ | |
| foreach( $options as &$option ){ | |
| if( 'three' == $option[ 'value' ] ){ | |
| $option[ 'selected' ] = 1; | |
| } | |
| } | |
| return $options; |
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 | |
| return [ | |
| 'connections' => [ | |
| 'heroku_pgsql' => [ | |
| 'driver' => 'pgsql', | |
| 'host' => @parse_url(getenv("DATABASE_URL"))['host'], | |
| 'port' => env('DB_PORT', '5432'), |
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 | |
| // ... | |
| /* | |
| * [attachment_image]246[/attachment_image] | |
| */ | |
| add_shortcode( 'attachment_image', 'my_attachment_image' ); | |
| function my_attachment_image( $atts, $content = false ){ | |
| if( ! $content || ! is_numeric( $content ) ) return; |
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 | |
| // ... | |
| /* | |
| * [wpautop]Your text/shortcode here[/wpautop] | |
| */ | |
| add_shortcode( 'wpautop', 'my_wpautop_shortcode' ); | |
| function my_wpautop_shortcode( $atts, $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
| diff --git a/includes/admin/metaboxes.php b/includes/admin/metaboxes.php | |
| index e4c02e9..9d093a4 100644 | |
| --- a/includes/admin/metaboxes.php | |
| +++ b/includes/admin/metaboxes.php | |
| @@ -149,7 +149,7 @@ class Envira_Albums_Metaboxes { | |
| // Bail if we're not on the Envira Post Type screen. | |
| if ( 'envira_album' !== $screen->post_type ) { | |
| - return; | |
| + return $body_class; |
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 | |
| /* | |
| * Register the new merge tag class on the `ninja_forms_loaded` hook. | |
| */ | |
| add_action( 'ninja_forms_loaded', 'my_register_merge_tags' ); | |
| function my_register_merge_tags(){ | |
| require_once 'class.mergetags.php'; | |
| Ninja_Forms()->merge_tags[ 'my_merge_tags' ] = new My_MergeTags(); |
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 if ( ! defined( 'ABSPATH' ) ) exit; | |
| add_action( 'ninja_forms_register_actions', function( $actions ){ | |
| include_once 'resume-action.php'; | |
| $actions[ 'resume' ] = new Foo_ResumeAction(); | |
| return $actions; | |
| }); |
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 | |
| $form_id = 1; | |
| // Check which version of Ninja Forms. | |
| if( ! get_option( 'ninja_forms_load_deprecated', FALSE ) ){ | |
| // Ninja Forms THREE. | |
| // Check if Ninja Forms is loaded. |
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( 'ninja_forms_action_email_message', 'kbj_nf_email__all_fields_with_values', 10, 3 ); | |
| function kbj_nf_email__all_fields_with_values( $message, $data, $action_settings ){ | |
| if( isset( $data[ 'fields' ] ) && ! empty( $data[ 'fields' ] ) ){ | |
| $table = '<table>'; | |
| foreach( $data[ 'fields' ] as $field ){ | |
| if( ! isset( $field[ 'value' ] ) || empty( $field[ 'value' ] ) ) continue; |