#169 – Filter "weeblramp_should_amplify_page"

Posted in ‘weeblrAMP’
This is a public ticket. Everybody will be able to see its contents. Only enter usernames, passwords or any other sensitive information in the Private information field.
Thursday, 08 August 2019 16:23 UTC
wdwprepschool
 Hello,
I want to exclude page templates that use the template named monthly-page.php. I tried to use the following filter from the docs, but it didn't work. Can you point me in the right direction?

add_filter(
    'weeblramp_should_amplify_page',
    function ( $shouldAmplifyPage ) {
        if ( is_page_template('monthly-page.php') ) {
                $shouldAmplifyPage = false;
            }
        }
        return $shouldAmplifyPage;
    },
    10,
    2
);
Friday, 09 August 2019 08:43 UTC
wb_weeblrpress
HI

You have a syntax error in the code above, the correct code is:

add_filter(
	'weeblramp_should_amplify_page',
	function ($shouldAmplifyPage, $query, $page) {
		if (is_page_template('monthly-page.php'))
		{
			$shouldAmplifyPage = false;
		}
		return $shouldAmplifyPage;
	},
	10,
	3
);


Does this work then?

Best regards
 
Friday, 09 August 2019 17:11 UTC
wdwprepschool
Yes, it worked perfectly! Thanks so much!!
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.