Advertisement
pixedelic

PixGridder filters

Oct 4th, 2014
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.27 KB | None | 0 0
  1. <?php
  2. function pix_replace_default_lang_switcher() {
  3.         global $icl_language_switcher;
  4.         remove_filter( 'wp_nav_menu_items', array($icl_language_switcher, 'wp_nav_menu_items_filter') );
  5. }
  6. add_action('init','pix_replace_default_lang_switcher');
  7.  
  8.  
  9. if ( !function_exists( 'pixgridder_col_extra_height' ) ) :
  10. /**
  11. * Increases height for PixGridder column on UI
  12. */
  13. add_filter('pixgridder_col_extra_height', 'pixgridder_col_extra_height', 1);
  14. function pixgridder_col_extra_height(){
  15.     return '730';
  16. }
  17. endif;
  18.  
  19.  
  20. if ( !function_exists( 'pixgridder_builder_extra_fields' ) ) :
  21. /**
  22. * Add fields to PixGridder builder for rows
  23. * // It will add data-extra="value" to the row on the backend
  24. */
  25. add_filter('pixgridder_row_extra_fields_2', 'pixgridder_builder_extra_fields', 1);
  26. function pixgridder_builder_extra_fields(){ ?>
  27.     <label><?php _e( 'Select a type', 'pixgridder' ); ?>:</label>
  28.     <label class="for_select hidden">
  29.         <span class="for_select">
  30.             <select data-extra="true">
  31.                 <option value=""><?php _e('none', 'pixgridder'); ?></option>
  32.                 <option value="fullwidth"><?php _e('fullwidth', 'pixgridder'); ?></option>
  33.                 <option value="fullscreen"><?php _e('fullscreen', 'pixgridder'); ?></option>
  34.                 <option value="text-box"><?php _e('text-box', 'pixgridder'); ?></option>
  35.             </select>
  36.         </span>
  37.     </label>
  38.  
  39.     <div class="clear"></div>
  40.  
  41. <?php }
  42. endif;
  43.  
  44.  
  45. if ( !function_exists( 'pixgridder_cols_extra_fields2' ) ) :
  46. /**
  47. * Add fields to PixGridder builder for columns
  48. * // "data-style" value is turned into CSS property on the front end
  49. * // and the field value will be its value
  50. * // If "data-unit" is available, its value will be added to the field value
  51. */
  52. add_filter('pixg_col_extra_fields2', 'pixgridder_cols_extra_fields2', 1);
  53. function pixgridder_cols_extra_fields2(){ ?>
  54.  
  55.     <div class="clear"></div>
  56.  
  57.     <label><?php _e('Padding, in percentage (leave empty for the default value)','pixgridder'); ?>:</label>
  58.     <div class="slider_div percent">
  59.         <input data-style="padding" data-unit="%" type="text" value="">
  60.         <div class="slider_cursor"></div>
  61.     </div><!-- .slider_div -->
  62.     <br>
  63.  
  64.     <div class="clear"></div>
  65.  
  66.     <label><?php _e('Padding top (if different from the general one)','pixgridder'); ?>:</label>
  67.     <div class="slider_div grid">
  68.         <input data-style="padding-top" data-unit="%!important" type="text" value="">
  69.         <div class="slider_cursor"></div>
  70.     </div><!-- .slider_div -->
  71.     <br>
  72.  
  73.     <div class="clear"></div>
  74.  
  75.     <label><?php _e('Padding bottom (if different from the general one)','pixgridder'); ?>:</label>
  76.     <div class="slider_div grid">
  77.         <input data-style="padding-bottom" data-unit="%!important" type="text" value="">
  78.         <div class="slider_cursor"></div>
  79.     </div><!-- .slider_div -->
  80.     <br>
  81.  
  82. <?php }
  83. endif;
  84.  
  85.  
  86. if ( !function_exists( 'pixgridder_cols_extra_fields' ) ) :
  87. /**
  88. * Adds fields to PixGridder builder for columns
  89. * // "data-style" value is turned into CSS property on the front end
  90. * // and the field value will be its value
  91. * // If "data-unit" is available, its value will be added to the field value
  92. */
  93. add_filter('pixg_col_extra_fields', 'pixgridder_cols_extra_fields', 1);
  94. function pixgridder_cols_extra_fields(){ ?>
  95.  
  96.     <div class="clear"></div>
  97.  
  98.     <label><?php _e( 'Background color', 'pixgridder' ); ?>:</label>
  99.     <div class="pix_color_picker">
  100.         <input data-style="background-color" type="text" value="">
  101.         <a class="pix_button" href="#"></a>
  102.         <div class="colorpicker"></div>
  103.         <i class="scicon-elusive-cancel"></i>
  104.     </div>
  105.  
  106.     <div class="clear"></div>
  107.  
  108.     <label><?php _e('Padding right (if different from the general one)','pixgridder'); ?>:</label>
  109.     <div class="slider_div grid">
  110.         <input data-style="padding-right" data-unit="%!important" type="text" value="">
  111.         <div class="slider_cursor"></div>
  112.     </div><!-- .slider_div -->
  113.     <br>
  114.  
  115.     <div class="clear"></div>
  116.  
  117.     <label><?php _e('Padding left (if different from the general one)','pixgridder'); ?>:</label>
  118.     <div class="slider_div grid">
  119.         <input data-style="padding-left" data-unit="%!important" type="text" value="">
  120.         <div class="slider_cursor"></div>
  121.     </div><!-- .slider_div -->
  122.     <br>
  123.  
  124. <?php }
  125. endif;
  126.  
  127.  
  128. if ( !function_exists( 'pixgridder_builder_col_classes' ) ) :
  129. /**
  130. * Adds some class to PixGridder columns
  131. */
  132. add_filter('pixgridder_colClassArr', 'pixgridder_builder_col_classes');
  133. function pixgridder_builder_col_classes(){
  134.     return '["custom_class", "different_class", "again_a_class"]';
  135. }
  136. endif;
  137.  
  138.  
  139. if ( !function_exists( 'pixgridder_builder_row_classes' ) ) :
  140. /**
  141. * Adds some class to PixGridder rows
  142. */
  143. add_filter('pixgridder_rowClassArr', 'pixgridder_builder_row_classes');
  144. function pixgridder_builder_row_classes(){
  145.     return '["custom_class", "different_class", "again_a_class"]';
  146. }
  147. endif;
  148.  
  149.  
  150. if ( !function_exists( 'pixgridder_builder_filter_colors' ) ) :
  151. /**
  152. * Adds presets colors to PixGridder rows
  153. */
  154. add_filter('pixgridder_featuredColors', 'pixgridder_builder_filter_colors');
  155. function pixgridder_builder_filter_colors(){
  156.     return '[
  157.     "#000000",
  158.     "#ffffff",
  159.     "#ff0000"
  160. ]';
  161. }
  162. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement