This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

jrevillini

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • in reply to: conditional slider selection #7190
    jrevillini
    Participant

    nevermind. I needed to list the # of params expected when I ran add_action. new code:

    add_action('themeblvd_element_slider_before', 'tunxiscc_element_slider_before', 1, 3);
    add_action('themeblvd_element_slider_after', 'tunxiscc_element_slider_after', 1, 3);

    that always gets me. i would think NOT putting anything would, by default, get everything passed, but no.

    in reply to: conditional slider selection #7188
    jrevillini
    Participant

    This is so freaking weird. OK. So I decided to add a new field to all elements called element visibility logic. Top of functions.php:

    function tunxiscc_element_mods ( $elements ) {
        $elements['slider']['options'][] = array(
    		    	'id' 		=> 'visibility_logic',
    				'name'		=> __( 'Element Visibility Logic ', TB_GETTEXT_DOMAIN ),
    				'desc'		=> __( 'Enter any PHP expression used to calculate visibility of this element within the layout. If the expression evaluates to false, the element will not be shown.<br><br><em>Example: is_page(1234)</em>', TB_GETTEXT_DOMAIN ),
    				'type'		=> 'text',
    			);
        return $elements;
    }
    add_filter( 'themeblvd_core_elements', 'tunxiscc_element_mods' );

    That works fine. Looking at the generic

    function themeblvd_elements( $layout, $location )

    function, it looks to me like the only way to conditionally show the element is to send everything to the output buffer starting at themeblvd_element_{type}_before and then conditionally output it at themeblvd_element_{type}_after. The problem is that I’m not getting the parameters you pass in your hooks. You have

    do_action( 'themeblvd_element_'.$element['type'].'_before', $id, $element['options'], $location ); // Before element: themeblvd_element_{type}_before

    So I should be getting 3 arguments, yet this does not output anything useful about the element I’m dealing with and in face gives me errors for arguments 2 and 3:

    function tunxiscc_element_slider_before ( $id, $options, $location ) {
    	echo '<!-- SLIDER ARGS ';
    	print_r (func_get_args());
    	echo '-->';
    }
    add_action('themeblvd_element_slider_before', 'tunxiscc_element_slider_before');

    And in fact, if I hack your builder.php file and output $element right before those do_action hooks, I DO SEE useful information.

    Here is the output from my hook:

    <!-- SLIDER ARGS Array
    (
        [0] => element_1
    )

    Here is the output of $element just before running those element hooks:

    Array
    (
        [type] => slider
        [query_type] => secondary
        [options] => Array
            (
                [slider_id] => home-slider
                [visibility] => Array
                    (
                        [hide_on_standard] => 0
                        [hide_on_tablet] => 0
                        [hide_on_mobile] => 0
                    )
    
                [visibility_logic] => !tunxiscc_weather_announcement_active()
            )
    
    )

    Totally baffled. Sorry to hit you with this crazy shit.

    in reply to: slider image uploader pop up is whacked out #7150
    jrevillini
    Participant

    Works. Sheeit. You know more about wordpress than I do. Sheeit.

    in reply to: slider image uploader pop up is whacked out #7147
    jrevillini
    Participant

    I have it set to the URL the public would use for the site (but I am staging changes hence the subdir): http://xxxx.edu/staging

    in reply to: slider image uploader pop up is whacked out #7143
    jrevillini
    Participant

    Dunno what to tell ya. If you go to add a new post while in the admin area under SSL, you get no warnings in the console. If you go to your slider manager under SSL in wp-admin, you get stuff like
    [blocked] The page at https://xxxx.edu/staging/wp-admin/admin.php?page=slider_blvd ran insecure content from http://xxxx.edu/staging/wp-includes/js/thickbox/thickbox.css.
    And it just doesn’t work while in SSL mode.

    in reply to: slider image uploader pop up is whacked out #7141
    jrevillini
    Participant

    you must have hardcoded some calls to stuff with the protocol as http. Newer browser security considers calls to grab content from http insecure when on https, so it blocks scripts and css and stuff.

    in reply to: slider image uploader pop up is whacked out #7140
    jrevillini
    Participant

    I figured it out. It doesn’t work if your admin area is available via SSL only, i.e. in wp-config.php you have
    define('FORCE_SSL_ADMIN', true);

    in reply to: slider image uploader pop up is whacked out #7137
    jrevillini
    Participant

    WP 3.5.1, Chrome 26.0.1410.43 m, Windows 7.

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