meta_fields = array( array( 'label' => __( 'Select image', 'adfoxly' ), 'id' => 'adfoxly-image_button', 'type' => 'button', 'group' => 'image', 'value' => 'Upload', 'data-media-uploader-target' => '#adfoxly-image', 'class' => 'btn btn-primary btn-fw adsettings-media', ), array( 'label' => 'Select image', 'id' => 'adfoxly-image', 'type' => 'hidden', 'show' => false, 'value' => '', 'data-parsley-errors-container' => '#alert-adfoxly-image', ), array( 'label' => 'Image preview', 'id' => 'adfoxly-ad-preview', 'type' => 'src', 'group' => 'image', 'value' => 'https://imgplaceholder.com/250x200/dddddd/757575/glyphicon-picture' ), array( 'label' => 'Ad Name', 'id' => 'adfoxly-ad-name', 'type' => 'text', 'class' => 'form-control' ), array( 'label' => 'Target URL', 'id' => 'adfoxly-target-url', 'type' => 'url', 'class' => 'form-control', 'group' => 'image', 'help-block' => 'What page will be open after user click on ad?', 'required' => false, 'data-parsley-errors-container' => '#alert-adfoxly-target-url' ), array( 'label' => 'Paste the Google AdSense code', 'id' => 'adfoxly-adsense-code', 'class' => 'form-control', 'group' => 'google-adsense', 'type' => 'textarea' ), ); if ( isset( $_GET[ 'edit' ] ) && is_numeric( $_GET[ 'edit' ] ) ) { $id = $_GET[ 'edit' ]; $getAdSenseCode = get_post_meta( $id, 'adfoxly-adsense-code', true ); if ( isset( $this->settings[ 'adfoxly-adsense-code' ] ) ) { $this->meta_fields[ 5 ][ 'value' ] = stripslashes( $getAdSenseCode ); } $getImageURL = get_post_meta( $id, 'adfoxly-image', true ); if ( isset( $getImageURL ) && ! empty( $getImageURL ) ) { $this->meta_fields[ 2 ][ 'value' ] = $getImageURL; } } } }