Forum Replies Created

Viewing 15 replies - 16 through 30 (of 34 total)
  • NOT OFFICIAL SUPPORT
    I’ve managed to make the theme work while they publish the needed update…

    Going to the file wp-content/themes/oceanwp/inc/template-helpers.php
    and changing the code removing the last comma in the 348 line the theme works:

    Previous code:

    $avatar_url .= get_avatar(
    	$author_id,
    	apply_filters( 'ocean_author_bio_avatar_size', $args['size'] ),
    	'',
    	esc_attr( $args['alt'] ),
    );

    Changed code:

    $avatar_url .= get_avatar(
    	$author_id,
    	apply_filters( 'ocean_author_bio_avatar_size', $args['size'] ),
    	'',
    	esc_attr( $args['alt'] )
    );

    I’ve only remove the last comma in the 348 line, and the theme works.

    NOTE: I don’t know if the get_avatar function needs another missed argument or the error is only the comma.

    Thread Starter ayam maiself

    (@electropatata)

    If I go to the file wp-content/themes/oceanwp/inc/template-helpers.php
    and I change the code removing the last comma in the 348 line the theme works:
    Previous code:

    $avatar_url .= get_avatar(
    	$author_id,
    	apply_filters( 'ocean_author_bio_avatar_size', $args['size'] ),
    	'',
    	esc_attr( $args['alt'] ),
    );

    Changed code:

    $avatar_url .= get_avatar(
    	$author_id,
    	apply_filters( 'ocean_author_bio_avatar_size', $args['size'] ),
    	'',
    	esc_attr( $args['alt'] )
    );

    I’ve only remove the last comma in the 348 line, and the theme works.
    I don’t know if the get_avatar function needs another missed argument or the error is only the comma.

    Thread Starter ayam maiself

    (@electropatata)

    I’ve activate the debuggin option and this send me this error:

    Parse error: syntax error, unexpected ‘)’ in /MY_DOMAIN_ROUTE/wp-content/themes/oceanwp/inc/template-helpers.php on line 349

    and this other one:

    PHP Fatal error: Uncaught Error: Call to undefined function oceanwp_error_page_template_content() in /MY_DOMAIN_ROUTE/wp-content/themes/oceanwp/404.php:15

    Thanks

    • This reply was modified 2 years, 11 months ago by ayam maiself.
    Thread Starter ayam maiself

    (@electropatata)

    The error still happens:
    It said (translated from spanish): “There has been a critical error on this website”
    And wordpress send me an email to enter in the recovery mode…
    It don’t give me any detailed info about the error, or I don’t know how to find it…

    • This reply was modified 2 years, 11 months ago by ayam maiself.
    • This reply was modified 2 years, 11 months ago by ayam maiself.
    Thread Starter ayam maiself

    (@electropatata)

    Hello,
    I’ve managed to add a custom plugin with the code:

    function my_pre_kses_filter( $string ) {
     
        global $allowedposttags;
        $allowedposttags['select'] = array( 'class' => true,
        					'autocomplete' => true,
        					'data-this-month' => true
        					);
        $allowedposttags['option'] = array( 'value' => true,
        					'selected' => true
        					);
     
        return $string;
    }
    add_filter( 'pre_kses', 'my_pre_kses_filter' );

    This code adds the needed SELECT and OPTION tags to the $allowedposttags global array needed by ICS Calendar, and then ICS Calendar works inside Directorist without change any code inside Directorist Plugin.

    Thread Starter ayam maiself

    (@electropatata)

    Hello,
    I’ve managed to add a custom plugin with the code:

    function my_pre_kses_filter( $string ) {
     
        global $allowedposttags;
        $allowedposttags['select'] = array( 'class' => true,
        					'autocomplete' => true,
        					'data-this-month' => true
        					);
        $allowedposttags['option'] = array( 'value' => true,
        					'selected' => true
        					);
     
        return $string;
    }
    add_filter( 'pre_kses', 'my_pre_kses_filter' );

    This code adds the needed SELECT and OPTION tags to the $allowedposttags global array, and then ICS Calendar works inside Directorist.

    Thanks @room34 for all the work and help

    • This reply was modified 2 years, 11 months ago by ayam maiself.
    Thread Starter ayam maiself

    (@electropatata)

    Lot of thanks for the work…

    I’ve test the changes and the SELECT is still removed from the code… This is now the only problem and now the calendar is not show (previously it shows all the months one bellow another, now it shows none), it only shows the month names but without any format. I’ve made a try adding the SELECT by myself to the resulting Directorist listing page code and this way the ICS Calendar works, so it’s now the only problem.

    I’ve see in the wordpress kses functions code that select tag is NOT allowed by default (i was thinking it only was the style problem)… Maybe the select tag can be added to the default kses array by the ICS plugin to allow it and then it will work.
    Maybe select can be added to the default kses allowed tag array by a custom plugin and it can be does by myself, but I don’t know how to do that, or if this will be a good idea.

    Here you can see the default array of tag allowed (it’s the first of the code, line 52).
    https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes/kses.php

    Thanks

    Thread Starter ayam maiself

    (@electropatata)

    Maybe the select is entire removed because it have the style=”display: none;” on it.

    The month are inside an article tag and it removes only the style=”display: none;”

    Without wp_kses_post() function:
    <article class="ics-calendar-month-wrapper" data-year-month="202211" style="display: none;">
    After wp_kses_post() function:
    <article class="ics-calendar-month-wrapper" data-year-month="202211">

    Maybe you can change this problem making the display:none in a css class and then add and remove the class to the tags, not by changing the style of the tag itself. If this works then if some other plugin uses the wp_kses_post() function, ICS Calendar will work on them too.

    Thread Starter ayam maiself

    (@electropatata)

    I can send you if you want the two calendars files generated inside and outside Directorist Plugin so you can check the differences, but are these differences:

    The wp_kses_post() functions take out every style=”display: none;” so all the calendar months displays at the same time.

    Too it take out all select tag around month names: This is the right portion of calendar code outside Directorist:

    <select class="ics-calendar-select" style="display: none;" autocomplete="off" data-this-month="202203">	
    						<option value="202203" selected="selected">Marzo 2022</option>	
    								<option value="202204">Abril 2022</option>	
    								<option value="202205">Mayo 2022</option>	
    								<option value="202206">Junio 2022</option>	
    								<option value="202207">Julio 2022</option>	
    								<option value="202208">Agosto 2022</option>	
    								<option value="202209">Septiembre 2022</option>	
    								<option value="202210">Octubre 2022</option>	
    								<option value="202211">Noviembre 2022</option>	
    								<option value="202212">Diciembre 2022</option>	
    								<option value="202301">Enero 2023</option>	
    								<option value="202302">Febrero 2023</option>	
    					</select>

    But inside Directorist plugin after wp_kses_post() is just the month names, like this, the select has been removed:

    Marzo 2022
    								Abril 2022
    								Mayo 2022
    								Junio 2022
    								Julio 2022
    								Agosto 2022
    								Septiembre 2022
    								Octubre 2022
    								Noviembre 2022
    								Diciembre 2022
    								Enero 2023
    								Febrero 2023
    • This reply was modified 2 years, 12 months ago by ayam maiself.
    Thread Starter ayam maiself

    (@electropatata)

    Thanks for your answer.
    I’ve wrownly thinking that locations can be only in one directory type, so I was creating a location previously existing and that was the problem.
    A visual problem happens when I activate Multi Directory… I’ve a tree of Categories and Locations, In the Listing creation I can see the tree of Categories and Locations to choose when I have Single Directory Activated. But When I activate Multi Directory, the Categories and Locations are listed alphabetically and don’t show the tree, so it’s a litle bit difficult to manage in this way.

    I’ve another question: Can I have One Single Linsting posted in two diferent directories in Multi Directory?
    I’ve made 2 Directories, but some of my Listings would be in both of them, not only One.

    Thanks

    Thread Starter ayam maiself

    (@electropatata)

    Thanks for your answer.
    I can’t find different global Settings for different directories.
    And I can’t find any way to assign the location to the new directory in the Location Settings at Global Settings Page like you say …

    (I can find different Directory Builders for each directory and I’ve export the settings of the previous directory to the new one sucessfully and make the changes needed) but Global Settings seem to be the same for both, and I can’t find the location assigment you’re talking about.

    Thanks

    Thread Starter ayam maiself

    (@electropatata)

    Hello,

    I’ve found the problem between Directorist and ICS Calendar integration…

    It’s that Directorist is applying this Fuction to the listing Post Content: wp_kses_post()
    And the wp_kses_post() function deletes some style needed in ICS Calendar to show propertly.

    The code line that makes this inside Directorist Plugin is like that:
    <?php echo wp_kses_post( $listing->get_contents() ); ?>
    FILE: templaates/single/header.php (LINE 43)

    I can take out the function in this way:
    <?php echo $listing->get_contents(); ?>
    And then I can see ICS Calendar propertly inside Directorist.

    I don’t know way the function is needed and if I’m making any kind of security issue taking it out…(?)

    It’s needed any function to parse the Post Content? can be used any other function wich doesn’t affect ICS Calendar?

    Thanks in advance

    Thread Starter ayam maiself

    (@electropatata)

    Hello,

    I’ve found the problem between Directorist and ICS Calendar integration…

    It’s that Directorist is applying this Fuction to the listing Post Content: wp_kses_post()
    And the wp_kses_post() function deletes some style needed in ICS Calendar to show propertly.

    The code line that makes this inside Directorist Plugin is like that:
    <?php echo wp_kses_post( $listing->get_contents() ); ?>

    I can take out this function in this way:
    <?php echo $listing->get_contents(); ?>
    And then I can see ICS Calendar propertly inside Directorist.

    But I don’t know if this way (without any Funtion to parse the entire Post Content) am I making any kind of security issue…

    It’s needed any function to parse the Post Content?

    Thanks in advance

    Thread Starter ayam maiself

    (@electropatata)

    It will be great if the publication day can be exported and imported, same with expiration days of Listings or the “Never Expire” check.
    The publication day defines some visualization sorting of listings…
    The expiration day of a Listing is important in some cases and if it’s not exported and imported the information is lost.
    The same with multiple Taxonomies.
    I know that in settings I can set default expiration day, but if I had set it manually in every Listing I made, when later I export and import them… I need to set it again listing by listing…! If I’ve lots of listings it is crazy!!!
    Thanks

    Thread Starter ayam maiself

    (@electropatata)

    I’m going to test everything you suggest…

    Your ICS Calendar works propertly in a common post or page outside Directorist Plugin…

    The problems happens too in the real website (work well in common posts or pages, the error happens just in directorist plugin too), the links I’ve sent are from a testing website for the time being…
    Thanks for your answer…
    I will try to solve…

    • This reply was modified 3 years, 1 month ago by ayam maiself.
Viewing 15 replies - 16 through 30 (of 34 total)