Regex for Path Based Rules
-
Hi there,
If I want a dedicated CCSS for a page, I can use “Path Based Rules”.
I wish I could this feature with a king of regex : create CCSS for pages which match /my_cpt/*
Although the creation label states “Enter part of the url …”, it does seem to work that way.
Any idea ?
-
This topic was modified 5 years, 11 months ago by
fouedex.
-
This topic was modified 5 years, 11 months ago by
-
if you use
my_cpt/as path in path-based-rule then that will apply tomy_cpt/page_aandmy_cpt/page_b. Alternatively you should be able to select your CPT in the list of conditional tags.hope this helps,
frankHi & thanks.
My CPT are all generated by Toolset, but not available in the list of conditional tags, even though declared public. Any idea ?
As a workaround, I use a path based rule, since CPT permalink embed the CPT slug.
F.
hmm, the CPT’s should show there. what version of the plugin are you using?
Latest : 3.3.10
As a complement, I have a CPT say “agency” which URL is //…/agency/…
As I can’t see them in the list, I created a Path based Rule (Path = /agency/).
Pages I see in the job queue are still associated with target “is_single” and I see “To be fetched from criticalcss.com in the next queue run…” for a long time (ao_ccss_queue runs normally every 10 min).Latest : 3.3.10
no, AO (CCSS) version I mean π
I created a Path based Rule (Path = /agency/).
Pages I see in the job queue are still associated with target βis_singleβ and I see βTo be fetched from criticalcss.com in the next queue runβ¦β for a long time (ao_ccss_queue runs normally every 10 min).Try creating a manual rule instead maybe (and use
agency/instead of/agency/)?AO : 2.6.2
AO CCSS power-up : 1.18.0
Both latest I believe.Hmm … maybe download & install AO 2.7 beta (which has built-in critical css support), deactivate AO 2.6, activate 2.7 (beta 4) and then deactivate the power-up to allow AO proper to take over CCSS duties?
I tested AO 27 with the “Custom post types” plugin and at least those are listed in the dropdown.
AO27 will be release next week (on May 1st) π
Still no luck with beta : none Toolset created types listed.
Hmm … I’ll install Toolset and test later today/ tomorrow.
arghh, toolset is not on wordpress.org, only premium version. no can test mate, sorry … :-/ given it’s premium you’re entitled to support, maybe ask them why AOCCSS can’t see their CPT’s (but can see ones created by e.g. https://wordpress.org/plugins/custom-post-types/). Relevant code is at https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeCriticalCSSCore.php#L192-L203
just tested with https://wordpress.org/plugins/custom-post-type-ui/, CPT’s created with that appear as well ..
Super weird π
$cpts = get_post_types( array( 'public' => true, '_builtin' => false, ), 'names', 'and' );actually returns the custom types, but still, they are not available in the drop down…
-
This reply was modified 5 years, 11 months ago by
fouedex.
Darn, the types are extended on
initaction but that’s probably too early for toolset :-/Don’t want to change the default action hook for “extend types” at this point (a couple of days before release), but I added a filter in 2.7 which allows you to change the action hook yourself. So download the new beta zipfile here, install it instead of the current 2.7 and once done add a code snippet like e.g. this one to change the hook from the default
inittowp_loaded;add_filter('autoptimize_filter_ccss_extend_types_hook', function (){return 'wp_loaded';});frank
Thanks !
Done, but still no luck, no Toolset post types in drop down.
F.
-
This reply was modified 5 years, 11 months ago by
fouedex.
-
This reply was modified 5 years, 11 months ago by
The topic ‘Regex for Path Based Rules’ is closed to new replies.