Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.4
- * @ Author : DeZender
- * @ Release on : 21.10.2015
- * @ Official site : http://DeZender.Net
- *
- */
- function wpttema_get_option($name) {
- $options = get_option("wpttema_options");
- if (isset($options[$name]))
- {
- return $options[$name];
- }
- return;
- }
- function wpttema_update_option($name, $value) {
- $options = get_option("wpttema_options");
- $options[$name] = $value;
- return update_option("wpttema_options", $options);
- }
- function wpttema_delete_option($name) {
- $options = get_option("wpttema_options");
- unset($options[$name]);
- return update_option("wpttema_options", $options);
- }
- function custom_css() {
- wp_register_style("custom-css", get_template_directory_uri() . "/css/custom-css.php");
- wp_enqueue_style("custom-css");
- return;
- }
- function wpt_widgets_init() {
- 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>"));
- 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>"));
- 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>"));
- return;
- }
- function mytheme_add_box() {
- global $meta_box;
- add_meta_box($meta_box["id"], $meta_box["title"], "mytheme_show_box", $meta_box["page"], $meta_box["context"], $meta_box["priority"]);
- return;
- }
- function mytheme_show_box() {
- global $meta_box;
- global $post;
- echo "<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"";
- echo wp_create_nonce(basename(__FILE__));
- echo "\" />";
- echo "<table class=\"form-table\">";
- foreach ($meta_box["fields"] as $field)
- {
- $meta = get_post_meta($post["ID"], $field["id"], true);
- echo "<tr>";
- echo "<th style=\"width:20%\"><label for=\"";
- echo $field["id"];
- echo "\">";
- echo $field["name"];
- echo "</label></th>";
- echo "<td>";
- switch ($field["type"])
- {
- case "text":
- {
- echo "<input type=\"text\" name=\"";
- echo $field["id"];
- echo "\" id=\"";
- echo $field["id"];
- echo "\" value=\"";
- echo $meta ? $meta : ($field["std"]);
- echo "\" size=\"30\" style=\"width:97%\" />";
- echo "<br />";
- echo $field["desc"];
- break;
- }
- case "textarea":
- {
- echo "<textarea name=\"";
- echo $field["id"];
- echo "\" id=\"";
- echo $field["id"];
- echo "\" cols=\"60\" rows=\"4\" style=\"width:97%\">";
- echo $meta ? $meta : ($field["std"]);
- echo "</textarea>";
- echo "<br />";
- echo $field["desc"];
- break;
- }
- case "select":
- {
- echo "<select name=\"";
- echo $field["id"];
- echo "\" id=\"";
- echo $field["id"];
- echo "\">";
- foreach ($field["options"] as $option)
- {
- echo "<option";
- echo $meta == $option ? " selected=\"selected\"" : "";
- echo ">";
- echo $option;
- echo "</option>";
- continue;
- }
- echo "</select>";
- break;
- }
- case "radio":
- {
- foreach ($field["options"] as $option)
- {
- echo "<input type=\"radio\" name=\"";
- echo $field["id"];
- echo "\" value=\"";
- echo $option["value"];
- echo "\"";
- echo $meta == $option["value"] ? " checked=\"checked\"" : "";
- echo " />";
- echo $option["name"];
- continue;
- }
- break;
- }
- case "checkbox":
- {
- echo "<input type=\"checkbox\" name=\"";
- echo $field["id"];
- echo "\" id=\"";
- echo $field["id"];
- echo "\"";
- echo $meta ? " checked=\"checked\"" : "";
- echo " />";
- echo $field["desc"];
- }
- }
- echo "<td>";
- echo "</tr>";
- continue;
- }
- echo "</table>";
- return;
- }
- function mytheme_save_data($post_id) {
- global $meta_box;
- if (!wp_verify_nonce($_POST["mytheme_meta_box_nonce"], basename(__FILE__)))
- {
- return $post_id;
- }
- if (defined("DOING_AUTOSAVE") && DOING_AUTOSAVE)
- {
- return $post_id;
- }
- if ("page" == $_POST["post_type"])
- {
- if (!current_user_can("edit_page", $post_id))
- {
- return $post_id;
- }
- }
- if (!current_user_can("edit_post", $post_id))
- {
- return $post_id;
- }
- foreach ($meta_box["fields"] as $field)
- {
- $old = get_post_meta($post_id, $field["id"], true);
- $new = $_POST[$field["id"]];
- if ($new && $new != $old)
- {
- update_post_meta($post_id, $field["id"], $new);
- ....................................................................
- ..........................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement