Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try to open wp-config.php in the notepad++ then Open “Encoding” and change it to “UTF-8” and save file.

    This problem appear because you probably removed role “editor”, if yes you will need to add additional validation “if role exists” in all cases where the statement $role = get_role(‘editor’) appears.
    f.e.

    if ($_REQUEST['wlcms_o_editor_template_access'] == "1") {
            $role = get_role('editor');
            if ($role) {
                $role->add_cap('edit_theme_options');
            }
        } elseif ($_REQUEST['wlcms_o_editor_template_access'] == "0") {
            $role = get_role('editor');
            if ($role) {
                $role->remove_cap('switch_themes'); // Legacy
                $role->remove_cap('edit_themes'); // Legacy
                $role->remove_cap('edit_theme_options');
            }
        }

    Thread Starter megabait12

    (@megabait12)

    Partly, I decided this problem by writing few filters

    function custom_bookings_table_cols_template() {
        return array(
            'user_name' => __('Name', 'dbem'),
            'first_name' => __('First Name', 'dbem'),
            'last_name' => __('Last Name', 'dbem'),
            'event_name' => __('Event', 'dbem'),
            'event_date' => __('Event Date(s)', 'dbem'),
            'event_time' => __('Event Time(s)', 'dbem'),
            'user_email' => __('E-mail', 'dbem') . '<br /><input name="booking_search" type="text" value="" placeholder="Booking search"/>',
            'dbem_phone' => __('Phone Number', 'dbem'),
            'booking_spaces' => __('Spaces', 'dbem'),
            'booking_status' => __('Status', 'dbem'),
            'booking_date' => __('Booking Date', 'dbem'),
            'booking_price' => __('Total', 'dbem'),
            'booking_id' => __('Booking ID', 'dbem'),
            'booking_comment' => __('Booking Comment', 'dbem')
        );
    }
    
    add_filter('em_bookings_table_cols_template', 'custom_bookings_table_cols_template', 99);
    
    function custom_get_default_search($array_or_defaults = array(), $array = array()) {
        $defaults = array(
            'status' => false,
            'person' => true, //to add later, search by person's bookings...
            'blog' => get_current_blog_id(),
            'ticket_id' => false,
            'booking_search' => false
        );
        // sort out whether defaults were supplied or just the array of search values
        if (empty($array)) {
            $array = $array_or_defaults;
        } else {
            $defaults = array_merge($defaults, $array_or_defaults);
        }
        //figure out default owning permissions
        if (!current_user_can('edit_others_events')) {
            $defaults['owner'] = get_current_user_id();
        } else {
            $defaults['owner'] = false;
        }
        if (EM_MS_GLOBAL && !is_admin()) {
            if (empty($array['blog']) && is_main_site() && get_site_option('dbem_ms_global_events')) {
                $array['blog'] = false;
            }
        }
        $parent = new EM_Object();
    
        return $parent::get_default_search($defaults, $array);
    }
    
    add_filter('em_bookings_get_default_search', 'custom_get_default_search', 10, 2);

    But now stuck with em_bookings_build_sql_conditions, can’t add custom search conditions

    function custom_build_sql_conditions($args) {
        if ($args['custom_search']) {
            return $conditions['custom_search'] = 'booking_id=' . $args['booking_search'];
        }
    }
    
    add_filter('em_bookings_build_sql_conditions', 'custom_build_sql_conditions', 10);

    Could you help me?

    You can create shortcode and then put it in “Additional HTML Content” field

    function wpml_shortcode_func(){
    do_action('icl_language_selector');
    }
    add_shortcode( 'wpml_lang_selector', 'wpml_shortcode_func' );

    by default its output as select, but you create custom switcher https://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/

    You need to add trim to $url in file woocommerce-csvimport/includes/class-woocsv-product.php last function

    public function isValidUrl($url)
    	{
    		// alternative way to check for a valid url
    		// !development
    		if  (filter_var(trim($url), FILTER_VALIDATE_URL) === FALSE) return false; else return true;
    
    	}

    Problem appear if you have space before or after url

    megabait12

    (@megabait12)

    You can add to your functions.php add_filter('widget_text', 'do_shortcode'); then you can use shortcode in widget “Text” for ex. [cocosocial networks=”facebook,twitter,googleplus”]

    You need to apply filters

    $meta = get_post_meta(get_the_ID(), 'video', true);
                    $content = apply_filters('the_content', $meta);
                    echo $content;

Viewing 7 replies - 1 through 7 (of 7 total)