Ejemplo n.º 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 );
		}
Ejemplo n.º 2
0
							)
						),
						array(
							'selector' => '.above-footer-widgets-wrap ul.tabs li',
							'indent'   => "\t\t",
							'styles'   => array(
								$borderLeft . '-color' => wm_modify_color( wm_option( 'design-abovefooter-bg-color' ), 34, -34, ' !important' ),
								'border-bottom-color' => wm_modify_color( wm_option( 'design-abovefooter-bg-color' ), 34, -34, ' !important' ),
							)
						),
						array(
							'selector' => '.footer ul.tabs li',
							'indent'   => "\t\t",
							'styles'   => array(
								$borderLeft . '-color' => wm_modify_color( wm_option( 'design-footer-bg-color' ), 34, -34, ' !important' ),
								'border-bottom-color' => wm_modify_color( wm_option( 'design-footer-bg-color' ), 34, -34, ' !important' ),
							)
						),

				array(
					'custom' => '}' //end of responsive rules
				),



			/**
			* High DPI / Retina styles
			*/
				array(
					'custom' => '@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx) {'
				),
Ejemplo n.º 3
0
							'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' ),
						)
				),

			array(
				'selector' => '.login #nav a, .login #backtoblog a, .login #nav a:hover, .login #backtoblog a:hover',
				'styles'   => array(
					'background'  => wm_option( 'branding-login-link-bg-color', 'color' ),
					'color'       => wm_option( 'branding-login-accent-color', 'color !important' ),
					'padding'     => '3px',
					'text-shadow' => 'none',
					)
			)

		);