Skip to content

Commit

Permalink
1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
webmandesign committed May 27, 2015
1 parent 4634aa0 commit 10c6b4a
Show file tree
Hide file tree
Showing 24 changed files with 247 additions and 199 deletions.
231 changes: 134 additions & 97 deletions changelog.md

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions class-wm-amplifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author WebMan
*
* @since 1.0
* @version 1.1.3
* @version 1.2
*/
if ( ! class_exists( 'WM_Amplifier' ) ) {

Expand Down Expand Up @@ -152,7 +152,7 @@ public function __wakeup() {
* Setup the default hooks and actions
*
* @since 1.0
* @version 1.1.3
* @version 1.2
*
* @access public
*/
Expand All @@ -161,7 +161,7 @@ public function setup_actions() {
$actions = array(
'load_textdomain' => 'plugins_loaded', //Load textdomain
'register_metaboxes' => 'plugins_loaded', //Register metaboxes
'register_widgets' => 'widgets_init|-10', //Register widgets
'register_widgets' => 'init|-10', //Register widgets
'save_permalinks' => 'init', //Save custom permalinks
'register_post_types' => 'init', //Register post types
'custom_taxonomies' => 'init|98', //Register additional custom taxonomies
Expand Down Expand Up @@ -750,14 +750,15 @@ public function load_textdomain() {
/**
* Plugin deactivation
*
* @since 1.0.9.9
* @since 1.0.9.9
* @version 1.2
*
* @access public
*/
public function deactivate( $newname, $newtheme ) {
if (
current_user_can( 'activate_plugins' )
&& defined( 'WM_THEME_NAME' )
&& WM_THEME_NAME !== $newname
&& wp_get_theme()->get( 'Name' ) !== $newname
&& get_transient( 'wmamp-deactivate' )
) {
delete_transient( 'wmamp-deactivate' );
Expand Down
11 changes: 6 additions & 5 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package WebMan Amplifier
*
* @since 1.0
* @version 1.1.6
* @version 1.2
*/


Expand Down Expand Up @@ -459,9 +459,10 @@ function wma_widget_areas_array() {
/**
* Sidebar (display widget area)
*
* @since 1.0
* @since 1.0
* @version 1.2
*
* @param array $atts Setup attributes.
* @param array $atts Setup attributes.
*
* @return Sidebar HTML (with a special class of number of included widgets).
*/
Expand Down Expand Up @@ -542,7 +543,7 @@ function wma_sidebar( $atts = array() ) {
$output .= wmhook_sidebars_before();
}

$output .= "\r\n\r\n" . '<' . $atts['tag'] . ' class="' . $atts['class'] . '" data-id="' . $atts['sidebar'] . '" data-widgets-count="' . count( $atts['widgets'] ) . '"' . $atts['attributes'] . '>' . "\r\n"; //data-id is to prevent double ID attributes on the website
$output .= "\r\n\r\n" . '<' . tag_escape( $atts['tag'] ) . ' class="' . $atts['class'] . '" data-id="' . $atts['sidebar'] . '" data-widgets-count="' . count( $atts['widgets'] ) . '"' . $atts['attributes'] . '>' . "\r\n"; //data-id is to prevent double ID attributes on the website

$output .= apply_filters( 'wmhook_wmamp_' . 'sidebar_widgets_pre', '', $atts );

Expand All @@ -565,7 +566,7 @@ function_exists( 'ob_start' )

$output .= apply_filters( 'wmhook_wmamp_' . 'sidebar_widgets_post', '', $atts );

$output .= "\r\n" . '</' . $atts['tag'] . '>' . "\r\n\r\n";
$output .= "\r\n" . '</' . tag_escape( $atts['tag'] ) . '>' . "\r\n\r\n";

if ( function_exists( 'wmhook_sidebars_after' ) ) {
$output .= wmhook_sidebars_after();
Expand Down
35 changes: 20 additions & 15 deletions includes/shortcodes/class-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @subpackage Shortcodes
*
* @since 1.0
* @version 1.1.7
* @version 1.2
*/
if ( ! class_exists( 'WM_Shortcodes' ) ) {

Expand Down Expand Up @@ -352,7 +352,7 @@ private function setup_globals() {
* Register styles and scripts
*
* @since 1.0
* @version 1.1
* @version 1.2
*
* @access public
*/
Expand All @@ -373,18 +373,18 @@ public function assets_register() {
}

//Scripts
wp_register_script( 'wm-imagesloaded', WMAMP_ASSETS_URL . 'js/plugins/imagesloaded.min.js', array(), WMAMP_VERSION, true );
wp_register_script( 'wm-isotope', WMAMP_ASSETS_URL . 'js/plugins/isotope.pkgd.min.js', array(), WMAMP_VERSION, true );
wp_register_script( 'wm-jquery-bxslider', WMAMP_ASSETS_URL . 'js/plugins/jquery.bxslider.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-jquery-lwtCountdown', WMAMP_ASSETS_URL . 'js/plugins/jquery.lwtCountdown.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-jquery-owl-carousel', WMAMP_ASSETS_URL . 'js/plugins/owl.carousel' . $rtl . '.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-jquery-parallax', WMAMP_ASSETS_URL . 'js/plugins/jquery.parallax.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-accordion', WMAMP_ASSETS_URL . 'js/shortcode-accordion.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-ie', WMAMP_ASSETS_URL . 'js/shortcodes-ie.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-parallax', WMAMP_ASSETS_URL . 'js/shortcode-parallax.js', array( 'jquery', 'wm-jquery-parallax' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-posts', WMAMP_ASSETS_URL . 'js/shortcode-posts.js', array( 'jquery', 'wm-imagesloaded' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-slideshow', WMAMP_ASSETS_URL . 'js/shortcode-slideshow.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-tabs', WMAMP_ASSETS_URL . 'js/shortcode-tabs.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'imagesloaded', WMAMP_ASSETS_URL . 'js/plugins/imagesloaded.min.js', array(), WMAMP_VERSION, true );
wp_register_script( 'isotope', WMAMP_ASSETS_URL . 'js/plugins/isotope.pkgd.min.js', array(), WMAMP_VERSION, true );
wp_register_script( 'jquery-bxslider', WMAMP_ASSETS_URL . 'js/plugins/jquery.bxslider.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'jquery-lwtCountdown', WMAMP_ASSETS_URL . 'js/plugins/jquery.lwtCountdown.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'jquery-owl-carousel', WMAMP_ASSETS_URL . 'js/plugins/owl.carousel' . $rtl . '.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'jquery-parallax', WMAMP_ASSETS_URL . 'js/plugins/jquery.parallax.min.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-accordion', WMAMP_ASSETS_URL . 'js/shortcode-accordion.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-ie', WMAMP_ASSETS_URL . 'js/shortcodes-ie.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-parallax', WMAMP_ASSETS_URL . 'js/shortcode-parallax.js', array( 'jquery', 'jquery-parallax' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-posts', WMAMP_ASSETS_URL . 'js/shortcode-posts.js', array( 'jquery', 'imagesloaded' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-slideshow', WMAMP_ASSETS_URL . 'js/shortcode-slideshow.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-tabs', WMAMP_ASSETS_URL . 'js/shortcode-tabs.js', array( 'jquery' ), WMAMP_VERSION, true );
wp_register_script( 'wm-shortcodes-vc-addon', WMAMP_ASSETS_URL . 'js/shortcodes-vc-addons.js', array( 'wpb_js_composer_js_atts', 'wpb_js_composer_js_custom_views', 'isotope' ), WMAMP_VERSION, true );
} // /assets_register

Expand Down Expand Up @@ -861,7 +861,7 @@ public function init_beaver_builder_support() {
* @todo Support for Frontend Editor (VC4+)
*
* @since 1.0
* @version 1.1.7
* @version 1.2
*
* @access public
*/
Expand Down Expand Up @@ -937,6 +937,11 @@ function_exists( 'vc_map' )
if ( isset( $shortcode['params'] ) ) {
ksort( $shortcode['params'] );
}

// Fix required for Visual Composer 4.5.2+

$shortcode['params'] = array_values( $shortcode['params'] );

vc_map( $shortcode );
}
}
Expand Down
23 changes: 13 additions & 10 deletions includes/shortcodes/page-builder/beaver-builder/beaver-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @link https://www.wpbeaverbuilder.com/
*
* @since 1.1
* @version 1.1.5
* @version 1.2
*
* @package WebMan Amplifier
* @subpackage Shortcodes
Expand Down Expand Up @@ -67,14 +67,17 @@
* Upgrade link URL
*
* @since 1.1.6
* @version 1.1.6
* @version 1.2
*
* @param string $url
*/
if ( ! function_exists( 'wma_bb_upgrade_url' ) ) {
function wma_bb_upgrade_url( $url ) {
//Output
return $url . '&fla=67';

// Output

return esc_url( add_query_arg( 'fla', '67', $url ) );

}
} // /wma_bb_upgrade_url

Expand All @@ -84,7 +87,7 @@ function wma_bb_upgrade_url( $url ) {
* Get Beaver Builder shortcode definitions
*
* @since 1.1
* @version 1.1.6
* @version 1.2
*
* @param string $shortcode
* @param string $property
Expand All @@ -99,7 +102,7 @@ function wma_bb_shortcode_def( $shortcode, $property = '' ) {

$custom_modules_category = _x( 'WM Modules', 'Page builder modules category name.', 'wm_domain' );

if ( apply_filters( 'wma_wma_bb_shortcode_def_category_advanced', false, $shortcode ) ) {
if ( apply_filters( 'wmhook_shortcode_wma_bb_shortcode_def_category_advanced', false, $shortcode ) ) {
$custom_modules_category = __( 'Advanced Modules', 'fl-builder' ); //Taking translation from Beaver Builder plugin
}

Expand Down Expand Up @@ -227,7 +230,7 @@ function wma_bb_custom_modules_wrapper_class( $class, $module ) {
* Module output
*
* @since 1.1
* @version 1.1.5
* @version 1.2
*
* @param obj $module Page builder's current module object
* @param array $settings Settings passed from page builder form
Expand Down Expand Up @@ -283,7 +286,7 @@ function wma_bb_custom_module_output( $module, $settings = array() ) {
}

$replace = ( 'content' === $param ) ? ( $value ) : ( ' ' . $param . '="' . $value . '"' );
$replace = apply_filters( 'wma_bb_custom_module_output_parent_replace', $replace, $module, $param, $settings );
$replace = apply_filters( 'wmhook_shortcode_wma_bb_custom_module_output_parent_replace', $replace, $module, $param, $settings );

}

Expand Down Expand Up @@ -330,7 +333,7 @@ function wma_bb_custom_module_output( $module, $settings = array() ) {
}

$replace = ( 'content' === $param ) ? ( $value ) : ( ' ' . $param . '="' . $value . '"' );
$replace = apply_filters( 'wma_bb_custom_module_output_child_replace', $replace, $module, $param, $child, $settings );
$replace = apply_filters( 'wmhook_shortcode_wma_bb_custom_module_output_child_replace', $replace, $module, $param, $child, $settings );

}

Expand All @@ -351,7 +354,7 @@ function wma_bb_custom_module_output( $module, $settings = array() ) {

$shortcode_output = str_replace( array( '{{children}}', '{{items}}' ), $replace_children, $output['parent'] );

$shortcode_output = apply_filters( 'wma_bb_custom_module_output', $shortcode_output, $module, $settings );
$shortcode_output = apply_filters( 'wmhook_shortcode_wma_bb_custom_module_output', $shortcode_output, $module, $settings );

//Output
echo $shortcode_output;
Expand Down
4 changes: 2 additions & 2 deletions includes/shortcodes/renderers/call_to_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This file is being included into "../class-shortcodes.php" file's shortcode_render() method.
*
* @since 1.0
* @version 1.1.6
* @version 1.2
*
* @uses $codes_globals['colors'], $codes_globals['sizes']['values']
*
Expand Down Expand Up @@ -69,7 +69,7 @@
//caption
$atts['caption'] = trim( $atts['caption'] );
if ( $atts['caption'] ) {
$atts['caption'] = '<div class="wm-call-to-action-caption wm-call-to-action-element"><' . $atts['heading_tag'] . '>' . $atts['caption'] . '</' . $atts['heading_tag'] . '></div>';
$atts['caption'] = '<div class="wm-call-to-action-caption wm-call-to-action-element"><' . tag_escape( $atts['heading_tag'] ) . '>' . $atts['caption'] . '</' . tag_escape( $atts['heading_tag'] ) . '></div>';
}
//button_class
$atts['button_class'] = trim( 'wm-button ' . trim( $atts['button_class'] ) );
Expand Down
16 changes: 11 additions & 5 deletions includes/shortcodes/renderers/content_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This file is being included into "../class-shortcodes.php" file's shortcode_render() method.
*
* @since 1.0
* @version 1.1.6
* @version 1.2
*
* @param string align
* @param string class
Expand Down Expand Up @@ -171,7 +171,7 @@
);
} else {
$query_args = array(
'paged' => ( $atts['pagination'] ) ? ( $paged ) : ( 1 ),
'paged' => 1,
'post_type' => $atts['post_type'],
'posts_per_page' => $atts['count'],
'ignore_sticky_posts' => 1,
Expand All @@ -185,6 +185,12 @@
'terms' => explode( ',', $atts['tag'][1] )
) );
}

if ( $atts['pagination'] ) {
$query_args['paged'] = $paged;
} else {
$query_args['no_found_rows'] = true;
}
}

//Allow filtering the query
Expand Down Expand Up @@ -306,7 +312,7 @@
'image' => '',
'morelink' => ( $helpers['link'] ) ? ( '<div class="wm-content-module-element wm-html-element more-link"><a' . $helpers['link'] . '>' . apply_filters( 'wmhook_shortcode_' . 'read_more_text', __( 'Read more', 'wm_domain' ), $shortcode, $post_id, $atts ) . '</a></div>' ) : ( '' ),
'tag' => '',
'title' => ( $helpers['link'] ) ? ( '<header class="wm-content-module-element wm-html-element title"><' . esc_attr( $atts['heading_tag'] ) . '><a' . $helpers['link'] . '>' . get_the_title() . '</a></' . esc_attr( $atts['heading_tag'] ) . '></header>' ) : ( '<header class="wm-content-module-element wm-html-element title"><' . esc_attr( $atts['heading_tag'] ) . '>' . get_the_title() . '</' . esc_attr( $atts['heading_tag'] ) . '></header>' ),
'title' => ( $helpers['link'] ) ? ( '<header class="wm-content-module-element wm-html-element title"><' . tag_escape( $atts['heading_tag'] ) . '><a' . $helpers['link'] . '>' . get_the_title() . '</a></' . tag_escape( $atts['heading_tag'] ) . '></header>' ) : ( '<header class="wm-content-module-element wm-html-element title"><' . tag_escape( $atts['heading_tag'] ) . '>' . get_the_title() . '</' . tag_escape( $atts['heading_tag'] ) . '></header>' ),
);

//image layout element
Expand Down Expand Up @@ -424,12 +430,12 @@
$enqueue_scripts = array();
if ( $atts['scroll'] ) {
$enqueue_scripts = array(
'wm-jquery-owl-carousel',
'jquery-owl-carousel',
'wm-shortcodes-posts'
);
} elseif ( $atts['filter'] ) {
$enqueue_scripts = array(
'wm-isotope',
'isotope',
'wm-shortcodes-posts'
);
} elseif ( $masonry_layout ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/shortcodes/renderers/countdown_timer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This file is being included into "../class-shortcodes.php" file's shortcode_render() method.
*
* @since 1.0
* @version 1.1.6
* @version 1.2
*
* @uses $codes_globals['sizes']['values']
*
Expand Down Expand Up @@ -108,7 +108,7 @@

//Enqueue scripts
$enqueue_scripts = array(
'wm-jquery-lwtCountdown'
'jquery-lwtCountdown'
);

wma_shortcode_enqueue_scripts( $shortcode, $enqueue_scripts, $atts );
Expand Down
4 changes: 2 additions & 2 deletions includes/shortcodes/renderers/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This file is being included into "../class-shortcodes.php" file's shortcode_render() method.
*
* @since 1.0
* @version 1.1.6
* @version 1.2
*
* @param string icon
* @param string heading_tag (heading tag setup option for better SEO)
Expand Down Expand Up @@ -67,7 +67,7 @@
//Markup for "wm_accordion" parent shortcode

$output = "\r\n" . '<div class="' . esc_attr( trim( $atts['class']['wrapper'] . ' ' . $atts['tags'] ) ) . '">';
$output .= '<' . esc_attr( $atts['heading_tag'] ) . ' class="wm-item-title ' . esc_attr( trim( $atts['class']['title'] . ' ' . $atts['tags'] ) ) . '" data-tags="' . esc_attr( $atts['tags'] ) . '" data-tag-names="' . esc_attr( implode( '|', $atts['tag_names'] ) ) . '">' . $atts['title'] . '</' . esc_attr( $atts['heading_tag'] ) . '>';
$output .= '<' . tag_escape( $atts['heading_tag'] ) . ' class="wm-item-title ' . esc_attr( trim( $atts['class']['title'] . ' ' . $atts['tags'] ) ) . '" data-tags="' . esc_attr( $atts['tags'] ) . '" data-tag-names="' . esc_attr( implode( '|', $atts['tag_names'] ) ) . '">' . $atts['title'] . '</' . tag_escape( $atts['heading_tag'] ) . '>';
$output .= '<div class="' . esc_attr( trim( $atts['class']['content'] . ' ' . sanitize_html_class( strip_tags( $atts['title'] ) ) ) ) . '">' . $atts['content'] . '</div>';
$output .= '</div>' . "\r\n";

Expand Down
4 changes: 2 additions & 2 deletions includes/shortcodes/renderers/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This file is being included into "../class-shortcodes.php" file's shortcode_render() method.
*
* @since 1.0
* @version 1.1.6
* @version 1.2
*
* @uses $this->$codes_globals['colors'], $codes_globals['sizes']['values']
*
Expand Down Expand Up @@ -58,7 +58,7 @@
$atts['title'] = trim( $atts['title'] );
if ( $atts['title'] ) {
$atts['title'] = strip_tags( $atts['title'], $this->inline_tags );
$atts['title'] = '<' . esc_attr( $atts['heading_tag'] ) . ' class="wm-message-title wm-message-element">' . $atts['title'] . '</' . esc_attr( $atts['heading_tag'] ) . '>';
$atts['title'] = '<' . tag_escape( $atts['heading_tag'] ) . ' class="wm-message-title wm-message-element">' . $atts['title'] . '</' . tag_escape( $atts['heading_tag'] ) . '>';
}
//class
$atts['class'] = apply_filters( 'wmhook_shortcode_' . $shortcode . '_classes', $atts['class'], $atts );
Expand Down
Loading

0 comments on commit 10c6b4a

Please sign in to comment.