• 29-07-2020, 15:59:37
    #1
    Merhabalar theme-options.php tan dolayı 2 adet hata almaktayım birtanesi şöyle:
    theme-options.php kodları ise:

    <?php
    
    add_action('init','of_options');
    
    if (!function_exists('of_options')) {
        function of_options(){
        
            // VARIABLES
            $themename = wp_get_theme(STYLESHEETPATH . '/style.css');
            $themename = $themename['Name'];
            $shortname = "panel";
    
            // Populate OptionsFramework option in array for use in theme
            global $of_options;
            $of_options = get_option('of_options');
    
            $GLOBALS['template_path'] = OF_DIRECTORY;
    
            //Categori Ayarları
            $of_categories = array();  
            $of_categories_obj = get_categories('hide_empty=0');
            foreach ($of_categories_obj as $of_cat) {
                $of_categories[$of_cat->cat_ID] = $of_cat->cat_name;
            }
            $categories_tmp = array_unshift($of_categories, "Kategori seçiniz:");    
          
            //Sayfa Arraylar
            $of_pages = array();
            $of_pages_obj = get_pages('sort_column=post_parent,menu_order');    
            foreach ($of_pages_obj as $of_page) {
                $of_pages[$of_page->ID] = $of_page->post_name;
            }
            $of_pages_tmp = array_unshift($of_pages, "Sayfa seçiniz:");
        
            // Sayfaları Çek (ID)
            $options = array();  
            $page_dropdown = array();
            $page_dropdown_pages = get_posts('numberposts=-1&post_type=page&post_status=publish&orderby=name&order=asc');
            if ($page_dropdown_pages) {
                foreach ($page_dropdown_pages as $page) {
                    //$page_dropdown[$page->post_name] = $page->post_title;
                    $page_dropdown[$page->ID] = $page->post_title;
                }
            }
            $page_dropdown_none = $page_dropdown;
            $page_dropdown_none['0'] = __('None');
    
            // Kategori Çek (ID)
            $options = array();  
            $cat_dropdown = array();
            $cat_dropdown_cats = get_categories('orderby=name&order=date&hide_empty=0');
            if ($cat_dropdown_cats) {
                foreach ($cat_dropdown_cats as $cat) {
                    $cat_dropdown[$cat->term_id] = $cat->cat_name;
                }
            }
            $cat_dropdown_none = $cat_dropdown;
            $cat_dropdown_none['0'] = __('None');
    
            // Sayfaları Çek (ID)
            $options = array();  
            $post_dropdown = array();
            $post_dropdown_pages = get_posts('numberposts=-1&post_type=oyun&post_status=publish&orderby=name&order=asc');
            if ($post_dropdown_pages) {
                foreach ($post_dropdown_pages as $page) {
                    $post_dropdown[$page->ID] = $page->post_title;
                    //$page_dropdown[$page->ID] = $page->post_title;
                }
            }
            $page_dropdown_none = $post_dropdown;
            $page_dropdown_none['0'] = __('None');
    
    
            //Evet HAyır
            $evet_hayir = array("evet" => "Evet","hayir" => "Hayır");
    
    
            //Resim buton ayarları
            $options_thumb_align = array("alignleft" => "Sol","alignright" => "Sağ","aligncenter" => "Merkez");
    
            //Resim Link Ayarları
            $options_image_link_to = array("image" => "The Image","post" => "The Post");
    
            //Yazı adeti ayarları
            $featured_options_select = array("Adet seçiniz:","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29"
            ,"30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50");
    
            //Model adeti ayarları
            $model_select = array("Model adeti seçiniz:","6", "12", "18", "24", "30", "36","42","48","54","60");
    
            //Still Ayarları
            $alt_stylesheet_path = OF_FILEPATH . '/styles/';
            $alt_stylesheets = array();
    
            if ( is_dir($alt_stylesheet_path) ) {
                if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) {
                    while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) {
                        if(stristr($alt_stylesheet_file, ".css") !== false) {
                            $alt_stylesheets[] = $alt_stylesheet_file;
                        }
                    }    
                }
            }
    
            //Diğer Ayarlar
            $uploads_arr = wp_upload_dir();
            $all_uploads_path = $uploads_arr['path'];
            $all_uploads = get_option('of_uploads');
            $body_repeat = array("no-repeat","repeat-x","repeat-y","repeat");
            $body_pos = array("top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right");
            //Stylesheets Reader
            $alt_stylesheet_path = OF_FILEPATH . '/styles/';
            $alt_stylesheets = array();
    
            if ( is_dir($alt_stylesheet_path) ) {
                if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) {
                    while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) {
                        if(stristr($alt_stylesheet_file, ".css") !== false) {
                            $alt_stylesheets[] = $alt_stylesheet_file;
                        }
                    }    
                }
            }
    
            //More Options
            $all_pages = get_pages();
            $page_options = array();
            $page_list = array();
            $page_list_footer = array();
            $checked_options = array();
    
            foreach ($all_pages as $page){
                $page_list[] = "acera_nav_header_".$page->ID;
                $page_list_footer[] = "acera_nav_footer_".$page->ID;
                $page_title = get_page($page->ID);
                $page_options[] = $page_title->post_title;
                $checked_options[] = "not";
            }
    
            $uploads_arr = wp_upload_dir();
            $all_uploads_path = $uploads_arr['path'];
            $all_uploads = get_option('of_uploads');
            $thumbsekil= array("Solda","Şerit");
            $body_repeat = array("no-repeat","repeat-x","repeat-y","repeat");
            // Set the Options Array
            $options = array();
    
            /* --------------------------------------------------------------------------------------------------------- */
            $options[] = array( "name" => "Genel Ayarlar", "type" => "heading");
                $options[] = array( "name" => "Favicon",
                                    "desc" => "Favicon'u buradan ekleyebilirsiniz.",
                                    "id" => $shortname."Favicon",
                                    "std" => "",
                                    "type" => "upload");
                $options[] = array( "name" => "Site Logo",
                                    "desc" => "Logoyu buraya yükleyiniz.",
                                    "id" => $shortname."Logo",
                                    "std" => "",
                                    "type" => "upload");
            /* --------------------------------------------------------------------------------------------------------- */
            $options[] = array( "name" => "Anasayfa", "type" => "heading");
                $options[] = array( "name" => "Banner");
                $options[] = array( "name" => "Görsel",
                    "desc" => "Görseli buraya yükleyiniz.",
                    "id" => $shortname."BannerGorsel",
                    "std" => "",
                    "type" => "upload");
                $options[] = array( "name" => "Başlık", "id" => $shortname."BannerBaslik", "std" => "", "type" => "text");
                $options[] = array( "name" => "Açıklama", "id" => $shortname."BannerAciklama", "std" => "", "type" => "textarea");
                $options[] = array( "name" => "Link", "id" => $shortname."BannerLink", "std" => "", "type" => "text");
    
                $options[] = array( "name" => "Kampanya");
                $options[] = array( "name" => "Görsel",
                    "desc" => "Görseli buraya yükleyiniz.",
                    "id" => $shortname."KampanyaGorsel",
                    "std" => "",
                    "type" => "upload");
                $options[] = array( "name" => "Yazı 1", "id" => $shortname."KampanyaYazi1", "std" => "", "type" => "text");
                $options[] = array( "name" => "Yazı 2", "id" => $shortname."KampanyaYazi2", "std" => "", "type" => "text");
            /* --------------------------------------------------------------------------------------------------------- */
            $options[] = array( "name" => "Sosyal", "type" => "heading");  
                $options[] = array( "name" => "Facebook Linki", "id" => $shortname."Facebook", "std" => "", "type" => "text");
                $options[] = array( "name" => "Instagram Linki", "id" => $shortname."Instagram", "std" => "", "type" => "text");
                $options[] = array( "name" => "Twitter Linki", "id" => $shortname."Twitter", "std" => "", "type" => "text");
            /* --------------------------------------------------------------------------------------------------------- */
            $options[] = array( "name" => "İletişim", "type" => "heading");
                $options[] = array( "name" => "Telefon", "id" => $shortname."Tel", "std" => "", "type" => "text");
                $options[] = array( "name" => "Whatsapp", "id" => $shortname."Whatsapp", "std" => "", "type" => "text");
                $options[] = array( "name" => "E-Mail", "id" => $shortname."Mail", "std" => "", "type" => "text");
                $options[] = array( "name" => "Adres", "id" => $shortname."Adres", "std" => "", "type" => "textarea");
                $options[] = array( "name" => "Map", "id" => $shortname."Map", "std" => "", "type" => "textarea");          
                
                update_option('of_template',$options);            
                update_option('of_themename',$themename);  
                update_option('of_shortname',$shortname);
            }
        }
    ?>
    bu şekildedir 1. satırında hata veriyor yaptığım birkaç araştırmada gereksiz boşlukları silmem gerektiğini söylemişler fakat oda işe yaramadı.

    Bir diğer aldığım hata ise wp_enqueue_scripts, admin_enqueue_scripts, login_enqueue_scripts hataları bunlarda function.php de theme options'ı tanımladığımdan dolayı alıyorum daha önce bu tarz sorunla karşılaşmamıştım sanırım wordpress'in son güncellemelerinden sonra değişen birşey olmuş bu hataları nasıl çözebilirim?

    function.php :
    if ( STYLESHEETPATH == TEMPLATEPATH ) {
            define('OF_FILEPATH', TEMPLATEPATH);
            define('OF_DIRECTORY', get_bloginfo('template_directory'));
        } else {
            define('OF_FILEPATH', STYLESHEETPATH);
            define('OF_DIRECTORY', get_bloginfo('stylesheet_directory'));
        }
        require_once (OF_FILEPATH . '/admin/admin-functions.php');
        require_once (OF_FILEPATH . '/admin/admin-interface.php');
        require_once (OF_FILEPATH . '/admin/theme-options.php');
        require_once (OF_FILEPATH . '/admin/theme-functions.php');
    
        if( !is_admin()){
            wp_deregister_script('jquery');
            wp_register_script('jquery', (''), true, '1.10.2');
            wp_enqueue_script('jquery');
        }
  • 29-07-2020, 16:04:06
    #2
    wp_enqueue_scripts, admin_enqueue_scripts, login_enqueue_scripts hatalarını çözdüm function.php kodları aşağıdaki gibi değiştirdim:
    if ( STYLESHEETPATH == TEMPLATEPATH ) {
            define('OF_FILEPATH', TEMPLATEPATH);
            define('OF_DIRECTORY', get_bloginfo('template_directory'));
        } else {
            define('OF_FILEPATH', STYLESHEETPATH);
            define('OF_DIRECTORY', get_bloginfo('stylesheet_directory'));
        }
        require_once (OF_FILEPATH . '/admin/admin-functions.php');
        require_once (OF_FILEPATH . '/admin/admin-interface.php');
        require_once (OF_FILEPATH . '/admin/theme-options.php');
        require_once (OF_FILEPATH . '/admin/theme-functions.php');
    
        if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
        function my_jquery_enqueue() {
            wp_deregister_script('jquery');
            wp_register_script('jquery', "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", false, null);
            wp_enqueue_script('jquery');
        }