Advertisement
Guest User

Untitled

a guest
Sep 15th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function wpttema_get_option($name) {
  15.  
  16. $options = get_option("wpttema_options");
  17. if (isset($options[$name]))
  18. {
  19. return $options[$name];
  20. }
  21. return;
  22. }
  23.  
  24. function wpttema_update_option($name, $value) {
  25.  
  26. $options = get_option("wpttema_options");
  27. $options[$name] = $value;
  28. return update_option("wpttema_options", $options);
  29. }
  30.  
  31. function wpttema_delete_option($name) {
  32.  
  33. $options = get_option("wpttema_options");
  34. unset($options[$name]);
  35. return update_option("wpttema_options", $options);
  36. }
  37.  
  38. function custom_css() {
  39.  
  40. wp_register_style("custom-css", get_template_directory_uri() . "/css/custom-css.php");
  41. wp_enqueue_style("custom-css");
  42. return;
  43. }
  44.  
  45. function wpt_widgets_init() {
  46.  
  47. register_sidebar(array("name" => __("Anasayfa Sidebar", "wpt-tv"), "id" => "sidebar-sag", "description" => __("Sağ menüye bileşen ekler", "wpt-tv"), "before_widget" => "<div class=\"yanmenu\">", "after_widget" => "</div>", "before_title" => "<div class=\"heiki\">", "after_title" => "</div>"));
  48. register_sidebar(array("name" => __("Yazı içi Sidebar", "wpt-tv"), "id" => "sidebar-content", "description" => __("Konu içi sağ menüye bileşen ekler", "wpt-tv"), "before_widget" => "<div class=\"yanmenu\">", "after_widget" => "</div>", "before_title" => "<div class=\"heiki\">", "after_title" => "</div>"));
  49. register_sidebar(array("name" => __("Footer Sidebar", "wpt-tv"), "id" => "sidebar-footer", "description" => __("Footer menüye bileşen ekler", "wpt-tv"), "before_widget" => "<div class=\"bolme\">", "after_widget" => "</div>", "before_title" => "<div class=\"heiki\">", "after_title" => "</div>"));
  50. return;
  51. }
  52.  
  53. function mytheme_add_box() {
  54.  
  55. global $meta_box;
  56. add_meta_box($meta_box["id"], $meta_box["title"], "mytheme_show_box", $meta_box["page"], $meta_box["context"], $meta_box["priority"]);
  57. return;
  58. }
  59.  
  60. function mytheme_show_box() {
  61.  
  62. global $meta_box;
  63. global $post;
  64. echo "<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"";
  65. echo wp_create_nonce(basename(__FILE__));
  66. echo "\" />";
  67. echo "<table class=\"form-table\">";
  68. foreach ($meta_box["fields"] as $field)
  69. {
  70. $meta = get_post_meta($post["ID"], $field["id"], true);
  71. echo "<tr>";
  72. echo "<th style=\"width:20%\"><label for=\"";
  73. echo $field["id"];
  74. echo "\">";
  75. echo $field["name"];
  76. echo "</label></th>";
  77. echo "<td>";
  78. switch ($field["type"])
  79. {
  80. case "text":
  81. {
  82. echo "<input type=\"text\" name=\"";
  83. echo $field["id"];
  84. echo "\" id=\"";
  85. echo $field["id"];
  86. echo "\" value=\"";
  87. echo $meta ? $meta : ($field["std"]);
  88. echo "\" size=\"30\" style=\"width:97%\" />";
  89. echo "<br />";
  90. echo $field["desc"];
  91. break;
  92. }
  93. case "textarea":
  94. {
  95. echo "<textarea name=\"";
  96. echo $field["id"];
  97. echo "\" id=\"";
  98. echo $field["id"];
  99. echo "\" cols=\"60\" rows=\"4\" style=\"width:97%\">";
  100. echo $meta ? $meta : ($field["std"]);
  101. echo "</textarea>";
  102. echo "<br />";
  103. echo $field["desc"];
  104. break;
  105. }
  106. case "select":
  107. {
  108. echo "<select name=\"";
  109. echo $field["id"];
  110. echo "\" id=\"";
  111. echo $field["id"];
  112. echo "\">";
  113. foreach ($field["options"] as $option)
  114. {
  115. echo "<option";
  116. echo $meta == $option ? " selected=\"selected\"" : "";
  117. echo ">";
  118. echo $option;
  119. echo "</option>";
  120. continue;
  121. }
  122. echo "</select>";
  123. break;
  124. }
  125. case "radio":
  126. {
  127. foreach ($field["options"] as $option)
  128. {
  129. echo "<input type=\"radio\" name=\"";
  130. echo $field["id"];
  131. echo "\" value=\"";
  132. echo $option["value"];
  133. echo "\"";
  134. echo $meta == $option["value"] ? " checked=\"checked\"" : "";
  135. echo " />";
  136. echo $option["name"];
  137. continue;
  138. }
  139. break;
  140. }
  141. case "checkbox":
  142. {
  143. echo "<input type=\"checkbox\" name=\"";
  144. echo $field["id"];
  145. echo "\" id=\"";
  146. echo $field["id"];
  147. echo "\"";
  148. echo $meta ? " checked=\"checked\"" : "";
  149. echo " />";
  150. echo $field["desc"];
  151. }
  152. }
  153. echo "<td>";
  154. echo "</tr>";
  155. continue;
  156. }
  157. echo "</table>";
  158. return;
  159. }
  160.  
  161. function mytheme_save_data($post_id) {
  162.  
  163. global $meta_box;
  164. if (!wp_verify_nonce($_POST["mytheme_meta_box_nonce"], basename(__FILE__)))
  165. {
  166. return $post_id;
  167. }
  168. if (defined("DOING_AUTOSAVE") && DOING_AUTOSAVE)
  169. {
  170. return $post_id;
  171. }
  172. if ("page" == $_POST["post_type"])
  173. {
  174. if (!current_user_can("edit_page", $post_id))
  175. {
  176. return $post_id;
  177. }
  178. }
  179. if (!current_user_can("edit_post", $post_id))
  180. {
  181. return $post_id;
  182. }
  183. foreach ($meta_box["fields"] as $field)
  184. {
  185. $old = get_post_meta($post_id, $field["id"], true);
  186. $new = $_POST[$field["id"]];
  187. if ($new && $new != $old)
  188. {
  189. update_post_meta($post_id, $field["id"], $new);
  190. ....................................................................
  191. ..........................................
  192. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement