Example #1
0
		function wm_shortcode_prices( $atts, $content = null ) {
			extract( shortcode_atts( array(
				'table' => null
				), $atts )
				);

			if ( 'disable' === wm_option( 'cp-role-prices' ) )
				return;

			if ( ! $table )
				return;

			$i            = 0;
			$out          = '';
			$columnsArray = array();
			$table        = ( is_numeric( $table ) ) ? ( absint( $table ) ) : ( sanitize_title( $table ) );
			$field        = ( is_numeric( $table ) ) ? ( 'id' ) : ( 'slug' );

			//get the table columns
			wp_reset_query();
			$price_table = new WP_Query( array(
				'post_type'      => 'wm_price',
				'posts_per_page' => 6,
				'tax_query'      => array( array(
						'taxonomy' => 'price-table',
						'field'    => $field,
						'terms'    => $table
					) ),
				'post__not_in'   => get_option( 'sticky_posts' )
				) );
			if ( $price_table->have_posts() && $table ) {
				$columnSize = $price_table->post_count;

				$out .= '<div id="price-table-' . $table . '" class="price-table">';

				while ( $price_table->have_posts() ) :

					$price_table->the_post();

					$i++;

					//$last = ( $columnSize === $i ) ? ( ' last' ) : ( '' );

					$colorBg = ( wm_meta_option( 'price-color' ) ) ? ( wm_meta_option( 'price-color', null, 'color' ) ) : ( null );
					$styles  = ( $colorBg ) ? ( array( ' style="background-color: ' . $colorBg . '; color: ' . wm_modify_color( $colorBg, 200, -200 ) . ';"', ' style="background-color: ' . $colorBg . '; background-image: ' . preg_replace( '/\s+/', ' ', wm_css3_gradient( wm_modify_color( $colorBg, -8, -8 ), 32 ) ) . '; color: ' . wm_modify_color( $colorBg, 200, -200 ) . ';"' ) ) : ( array( '', '' ) );

					$outColumn = '<div class="price-column column no-margin col-1' . $columnSize . wm_meta_option( 'price-style' ) . '">';

						$outColumn .= '<div class="price-heading"' . $styles[0] . '>';
							$outColumn .= '<h3' . $styles[1] . '>' . get_the_title() . '</h3>';
							$outColumn .= '<p class="cost">' . wm_meta_option( 'price-cost' ) . '</p>';
							$outColumn .= '<p class="note">' . wm_meta_option( 'price-note' ) . '</p>';
							$outColumn .= '<div class="price-button">';
								$outColumn .= ( wm_meta_option( 'price-btn-text' ) ) ? ( '<p class="wrap-button">[button url="' . esc_url( wm_meta_option( 'price-btn-url' ) ) . '" color="' . wm_meta_option( 'price-btn-color' ) . '" size="medium"]' . wm_meta_option( 'price-btn-text' ) . '[/button]</p>' ) : ( '' );
							$outColumn .= '</div>';
						$outColumn .= '</div>';

						$outColumn .= '<div class="price-spec">';
						$outColumn .= apply_filters( 'wm_default_content_filters', get_the_content() );
						$outColumn .= '</div>';

						$outColumn .= '<div class="bottom"' . $styles[0] . '></div>';

					$outColumn .= '</div>';

					$colOrder = ( wm_meta_option( 'price-order' ) ) ? ( wm_meta_option( 'price-order' ) ) : ( -7 + $i );
					$columnsArray[$colOrder] = $outColumn;

				endwhile;

				ksort( $columnsArray );
				$out .= implode( "\r\n", $columnsArray );
				$out .= '</div>';

			}
			wp_reset_query();

			//output
			return do_shortcode( $out );
		}
Example #2
0
						'styles'   => array(
							'background-color' => wm_option( 'design-type-red-bg-color', 'color' ),
							'color'            => wm_modify_color( wm_option( 'design-type-red-bg-color' ), $textColorCoeficient, -$textColorCoeficient ),
							'text-shadow'      => ( WM_COLOR_TRESHOLD < wm_color_brightness( wm_option( 'design-type-red-bg-color' ) ) ) ? ( '0 1px rgba(255,255,255, .33)' ) : ( '0 -1px rgba(0,0,0, .33)' ),
						)
					),
						array(
							'selector' => '.box.color-red, .btn.color-red, .button.color-red',
							'styles'   => array(
								'border-color' => wm_modify_color( wm_option( 'design-type-red-bg-color' ), -17, -17 ),
							)
						),
						array(
							'selector' => '.btn.color-red, .button.color-red',
							'styles'   => array(
								'background-image' => wm_css3_gradient( wm_option( 'design-type-red-bg-color' ), 32 ),
							)
						),
						array(
							'selector' => '.call-to-action-title.red',
							'styles'   => array(
								'background-color' => wm_modify_color( wm_option( 'design-type-red-bg-color' ), 17, 17 ),
							)
						),
						array(
							'selector' => '.nav-main > ul > li > .btn.color-red:hover, .tp-caption .btn.color-red:hover',
							'styles'   => array(
								'color' => wm_modify_color( wm_option( 'design-type-red-bg-color' ), $textColorCoeficient, -$textColorCoeficient ),
							)
						),
						array(
Example #3
0
						'border-color'     => wm_modify_color( wm_option( 'branding-login-form-button-bg-color' ), -17, -17, ' !important' ),
						'color'            => wm_modify_color( wm_option( 'branding-login-form-button-bg-color' ), 150, -150, ' !important' ),
						'text-transform'   => 'uppercase',
						'text-shadow'      => 'none',
						)
				),
					array(
						'selector' => '#login input[type=submit]:hover',
						'styles'   => array(
							'background-image' => wm_css3_gradient( wm_modify_color( wm_option( 'branding-login-form-button-bg-color' ), 8, 8 ), 32 ),
							)
					),
					array(
						'selector' => '#login input[type=submit]:active',
						'styles'   => array(
							'background-image' => wm_css3_gradient( wm_modify_color( wm_option( 'branding-login-form-button-bg-color' ), -8, -8 ), 17 ),
							)
					),

			array(
				'selector' => '.login .message, .login #login_error',
				'styles'   => array(
					'background'   => wm_option( 'branding-login-message-bg-color', 'color' ),
					'border-color' => wm_modify_color( wm_option( 'branding-login-message-bg-color' ), 34, -34, ' !important' ),
					'color'        => wm_modify_color( wm_option( 'branding-login-message-bg-color' ), 150, -150, ' !important' ),
					)
			),
				array(
					'selector' => '.login .message a, .login #login_error a',
					'styles'   => array(
						'color' => wm_modify_color( wm_option( 'branding-login-message-bg-color' ), 180, -180, ' !important' ),