Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.0.8.0
  8. * @ Author : DeZender
  9. * @ Release on : 25.09.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function add_style_by_plugin_compare_quick_view_without()
  15. {
  16. if (!(defined( 'YITH_WOOCOMPARE' )) && !(defined( 'YITH_WCQV' ))) {
  17. echo '<style>' . "\r\n\t\t\t" . '.main_button_product{width:170px;}' . "\r\n\t\t\t" . '.main_button_product a.custom_add_to_cart_onliner{width:100%;white-space:nowrap;}' . "\r\n\t\t\t" . '.woocommerce ul.products li.product .custom_add_to_cart_onliner:before{display:inline;margin-left:6px;}' . "\r\n\t\t" . '</style>';
  18. }
  19.  
  20. if (defined( 'YITH_WOOCOMPARE' ) && !(defined( 'YITH_WCQV' ))) {
  21. echo '<style>' . "\r\n\t\t\t" . '.main_button_product a.custom_add_to_cart_onliner{width:50%;}' . "\r\n\t\t\t" . 'ul.products li a.compare.button{width:50%;}' . "\r\n\t\t" . '</style>'.'<script>jQuery(document).ready(function($){ ' . "\r\n\t\t\t" . 'jQuery(\'ul.products li.product .button.custom_add_to_cart_onliner\').text(\'\');' . "\r\n\t\t" . '});</script>';
  22. }
  23.  
  24. if (!(defined( 'YITH_WOOCOMPARE' )) && defined( 'YITH_WCQV' )) {
  25. echo '<style>' . "\r\n\t\t\t" . '.main_button_product{width:180px;}' . "\r\n\t\t\t" . '.main_button_product a.custom_add_to_cart_onliner{width:145px;white-space:nowrap;font-size:12px;}' . "\r\n\t\t\t" . '.woocommerce ul.products li.product .custom_add_to_cart_onliner:before{display:inline;}' . "\r\n\t\t" . '</style>'.'<script>jQuery(document).ready(function($){ ' . "\r\n\t\t\t" . 'jQuery(\'ul.products li a.yith-wcqv-button.button\').text(\'\');' . "\r\n\t\t" . '});</script>';
  26. }
  27. }
  28.  
  29. function custom_internal_css()
  30. {
  31. echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo( 'template_url' ) . '/option-tree/ot-custom-style.css" />';
  32. }
  33.  
  34. function wc_custom_add_custom_fields()
  35. {
  36. woocommerce_wp_textarea_input( array(
  37. 'id' => 'content_slider',
  38. 'label' => 'متن اسلایدر تخفیفات',
  39. 'description' => 'چنانچه برای این محصول زمان بندی مشخص کرده اید و میخواهید در اسلایدر تخفیفات زمان دار صفحه اصلی نمایش داده شود متن مختصری در این فیلد درج نمائید',
  40. 'desc_tip' => 'true',
  41. 'placeholder' => 'چنانچه برای این محصول زمان بندی مشخص کرده اید و میخواهید در اسلایدر تخفیفات زمان دار صفحه اصلی نمایش داده شود متن مختصری در این فیلد درج نمائید'
  42. ) );
  43. }
  44.  
  45. function wc_custom_save_custom_fields($post_id)
  46. {
  47. update_post_meta( $post_id, 'content_slider', esc_attr( $_POST['content_slider'] ) );
  48. }
  49.  
  50. function register_my_menus()
  51. {
  52. register_nav_menus( array( 'main-menu' => 'منو اصلی' ) );
  53. }
  54.  
  55. function get_image_id($image_url)
  56. {
  57. global $wpdb;
  58. $attachment = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->posts . ' WHERE guid=\'%s\';', $image_url ) );
  59. return $attachment[0];
  60. }
  61.  
  62. function __search_by_title_only($search, &$wp_query)
  63. {
  64. global $wpdb;
  65.  
  66. if (empty( $search )) {
  67. return $search;
  68. }
  69.  
  70. $q = @$wp_query->query_vars;
  71. $n = ((!(empty( $q['exact'] )) ? '' : '%'));
  72. @$search = '';
  73. @$searchand = '';
  74.  
  75. foreach ((array) $q['search_terms'] as $term) {
  76. $term = esc_sql( $wpdb->esc_like( $term ) );
  77. $search .= $searchand . '(' . $wpdb->posts . '.post_title LIKE \'' . $n . $term . $n . '\')';
  78. $searchand = ' AND ';
  79. }
  80.  
  81. if (!(empty( $search ))) {
  82. $search = ' AND (' . $search . ') ';
  83.  
  84. if (!(is_user_logged_in( ))) {
  85. $search .= ' AND (' . $wpdb->posts . '.post_password = \'\') ';
  86. }
  87. }
  88.  
  89. return $search;
  90. }
  91.  
  92. function remove_search_widget()
  93. {
  94. unregister_widget( 'WP_Widget_Search' );
  95. }
  96.  
  97. function wp_permalink()
  98. {
  99. echo '<a href="http://shop.onliner.ir/woocommerce-theme/" title="قالب ووکامرس" class="themework">قالب ووکامرس</a>';
  100. }
  101.  
  102. function remove_page_link_yith_licence()
  103. {
  104. echo '<style>#toplevel_page_yit_plugin_panel ul li:nth-last-child(-n+2) { display:none; }</style>';
  105. }
  106.  
  107. function custom_woocommerce_template_loop_product_thumbnail_by_onliner()
  108. {
  109. global $product;
  110. $product_id_person = $product->get_id( );
  111. ...........................................................................
  112. ......................................
  113. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement