Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Bump to version 1.0.3
Browse files Browse the repository at this point in the history
1. Fix video embeds
2. Fix media uploads not working for all necessary fields
3. Allow customization of CTA button text
4. Removed unused JS file
  • Loading branch information
Aaron Huisinga committed May 20, 2016
1 parent d170566 commit e1e43d1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 91 deletions.
2 changes: 1 addition & 1 deletion assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jQuery(document).ready(function ($) {
file_frame.open();
};

jQuery('#upload_media_file_button').click(function (event) {
jQuery('.upload_media_file').click(function (event) {
event.preventDefault();
jQuery.fn.ssp_upload_media_file(jQuery(this), false);
});
Expand Down
62 changes: 0 additions & 62 deletions assets/js/scripts.js

This file was deleted.

34 changes: 21 additions & 13 deletions classes/class-program-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function meta_box_content($post, $meta)
$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
$html .= '</td><tr/>' . "\n";
} elseif ($type == 'url') {
$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr($k) . '">' . $v['name'] . '</label></th><td><input type="button" class="button" id="upload_media_file_button" value="' . __('Upload Image', $this->token) . '" data-uploader_title="Choose an image" data-uploader_button_text="Insert image file" /><input name="' . esc_attr($k) . '" type="text" id="upload_media_file" class="regular-text" value="' . esc_attr($data) . '" />' . "\n";
$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr($k) . '">' . $v['name'] . '</label></th><td><input type="button" class="button upload_media_file" id="' . esc_attr($k) . '_button" value="' . __('Upload Image', $this->token) . '" data-uploader_title="Choose an image" data-uploader_button_text="Insert image file" /><input name="' . esc_attr($k) . '" type="text" id="' . esc_attr($k) . '" class="regular-text" value="' . esc_attr($data) . '" />' . "\n";
$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
$html .= '</td><tr/>' . "\n";
} else {
Expand Down Expand Up @@ -390,16 +390,6 @@ public function enqueue_scripts()
wp_enqueue_style($this->token);
wp_enqueue_style('animate');
wp_enqueue_style('source-sans');

wp_register_script($this->token . '-js', esc_url($this->assets_url . 'js/scripts.js'), [
'jquery'
], PROGRAM_PAGE_PLUGIN_VERSION);
wp_enqueue_script($this->token . '-js');

$localize = [
'ajaxurl' => admin_url('admin-ajax.php'),
];
wp_localize_script($this->token . '-js', 'ProgramPage', $localize);
}

}
Expand Down Expand Up @@ -437,9 +427,27 @@ public function get_custom_fields_settings($meta_box)
'section' => 'info'
];

$fields['cta'] = [
'name' => __('Call To Action', $this->token),
'description' => __('The call to action for your page', $this->token),
'placeholder' => 'WATCH THE VIDEO',
'type' => 'text',
'default' => 'WATCH THE VIDEO',
'section' => 'info'
];

$fields['cta_url'] = [
'name' => __('Call To Action URL', $this->token),
'description' => __('The URL the user is directed to upon clicking the CTA button.', $this->token),
'placeholder' => '',
'type' => 'text',
'default' => '',
'section' => 'info'
];

$fields['video_url'] = [
'name' => __('Video URL', $this->token),
'description' => __('The URL for the video on your page.', $this->token),
'name' => __('Video Embed URL', $this->token),
'description' => __('The embed code for your program video.', $this->token),
'placeholder' => '',
'type' => 'text',
'default' => '',
Expand Down
4 changes: 2 additions & 2 deletions program-page.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace ColdTurkey\ProgramPage;
/*
* Plugin Name: Program Page
* Version: 1.0.2
* Version: 1.0.3
* Plugin URI: http://www.coldturkeygroup.com/
* Description: Custom info pages for Platform ad campaigns
* Author: Cold Turkey Group
Expand All @@ -20,7 +20,7 @@
define( 'PROGRAM_PAGE_PLUGIN_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );

if ( ! defined( 'PROGRAM_PAGE_PLUGIN_VERSION' ) )
define( 'PROGRAM_PAGE_PLUGIN_VERSION', '1.0.2' );
define( 'PROGRAM_PAGE_PLUGIN_VERSION', '1.0.3' );

require_once( 'classes/class-program-page.php' );

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: Aaron Huisinga
Tags: real estate, platform, days on market
Requires at least: 3.5
Tested up to: 4.3
Stable tag: 1.0.2
Stable tag: 1.0.3

Custom info pages for Platform ad campaigns (currently supports the HIP Program).

Expand Down
41 changes: 29 additions & 12 deletions templates/hip-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
$id = get_the_ID();
$title = get_the_title();
$logo = get_post_meta($id, 'logo', true);
$cta = get_post_meta($id, 'cta', true);
$cta_url = get_post_meta($id, 'cta_url', true);
$video_url = get_post_meta($id, 'video_url', true);
$broker = get_post_meta($id, 'legal_broker', true);
$test_1_name = get_post_meta($id, 'test_1_name', true);
Expand Down Expand Up @@ -116,7 +118,7 @@
<div class="line banner-line role-element leadstyle-container"></div>
<p class="banner-list role-element leadstyle-text">no credit requirements | no income requirements</p>
<div class="btn-inline-wrap">
<a class="btn btn-inline role-element leadstyle-link" href="<?= $video_url ?>" target="_blank">WATCH THE VIDEO</a>
<a class="btn btn-inline role-element leadstyle-link" href="<?= $cta_url ?>" target="_blank"><?= $cta ?></a>
</div>
</div>
</div>
Expand All @@ -142,7 +144,7 @@
</div>
<div class="col-xs-12 col-md-5 vcenter text-right text-xs-center text-sm-center role-element leadstyle-container">
<div class="video-container role-element leadstyle-video video" data-lp-responsive="height" data-lp-ratio-height="0.5625" data-lp-ratio-width="1.7777777777777777" style="width: 100%;">
<iframe src="<?= $video_url ?>" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" data-aspectratio="0.5625" style="width: 458px; height: 257.625px;"></iframe>
<?= $video_url ?>
</div>
</div>
</div>
Expand Down Expand Up @@ -255,15 +257,30 @@
</footer>

<?php if ($retargeting != null) { ?>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '<?= $retargeting ?>');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=<?= $retargeting ?>&ev=PageView&noscript=1"/></noscript>
<!-- Facebook Pixel Code -->
<script>
!function (f, b, e, v, n, t, s) {
if (f.fbq)return;
n = f.fbq = function () {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq)f._fbq = n;
n.push = n;
n.loaded = !0;
n.version = '2.0';
n.queue = [];
t = b.createElement(e);
t.async = !0;
t.src = v;
s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window,
document, 'script', '//connect.facebook.net/en_US/fbevents.js');
fbq('init', '<?= $retargeting ?>');
fbq('track', "PageView");</script>
<noscript>
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=<?= $retargeting ?>&ev=PageView&noscript=1"/>
</noscript>
<?php } ?>
<?php wp_footer(); ?>

0 comments on commit e1e43d1

Please sign in to comment.