codemonkeynorth
Forum Replies Created
-
i found why my original workaround failed in some cases
[if check={PARAM} value="{PARAM}"] param not passed [else] {PARAM} [/if]
if
param
does not contain a space it doesn’t work[myshortcode param="foo"]
shows “param not passed”
[myshortcode param="foo bar"]
shows “foo bar”found another temporary workaround, for anybody awaiting a fix:
[myshortcode]
[myshortcode param="foo"]
[if exists][format split="{}" part=2]{PARAM}[/format][show] param was not passed [else] param was passed as {PARAM} [/if]
what the format split does is create the literal string “PARAM” if no param is passed, or creates a blank string if a param *was* passed, since there are no
{}
brackets to split on due to it being parsed to an actual value- This reply was modified 3 years, 9 months ago by codemonkeynorth.
above doesn’t seem to work anymore
anybody know a way to check if a param wasn’t passed?
thanks
Sorry missed that. Closing
Thanks
Forum: Plugins
In reply to: [Disable Gutenberg] conflict with “Custom Permalinks” pluginHi @specialk
no WP 5.5 doesn’t fix it. my guess is that his code is expecting gutenberg to be present (or not for earlier versions of WP), but therefore also needs to check the presence of this extra disabling filter. (which I’m assuming your plugin also uses)
I’ll close this here as it’s not specifically related to your plugin.
thanks
JForum: Plugins
In reply to: [Disable Gutenberg] conflict with “Custom Permalinks” plugin@specialk thanks
it appears just disabling gutenberg through code (
use_block_editor_for_post_type
filter) rather than using any of the plugins also breaks itI’ll try WP 5.5 and see if it fixes it
regards
JForum: Plugins
In reply to: [Custom Permalinks] custom permalinks input box missing / disappearsappears to be a conflict with disabling Gutenberg
eg with these (or via code below)
https://wordpress.org/plugins/disable-gutenberg/
https://en-gb.wordpress.org/plugins/classic-editor/add_filter("use_block_editor_for_post_type", "disable_gutenberg_editor"); function disable_gutenberg_editor() { return false; }
if i use any of these methods, it breaks
So i’m guessing it’s a problem with the Custom Permalinks plugin maybe expecting Gutenberg to be present?
thanks
J- This reply was modified 3 years, 10 months ago by codemonkeynorth.
Hi @polarracing
But without putting everything onto one line in the CCS editor, I’m confused how to avoid white space? (The Logic code above isn’t in my page content field, it’s in the Shortcodes editor that comes with CCS – enable Meta Shortcodes in settings.. see /wp-admin/options-general.php?page=ccs_reference&tab=meta-shortcodes)
Then I’m either running it as
$fees = do_shortcode(‘[total_fees]’);
or I have the[total_fees]
shortcode within content in one of my wysiwyg ACF fields and I’m outputting that field in the templateI don’t see how the latter is relevant though, it’s the CCS shortcode that’s returning the whitespace from its editor
- This reply was modified 4 years ago by codemonkeynorth.
hi @polarracing
I mentioned in my original comment that the line breaks are there for readability of the logic. compare with the end of the post where I’ve stripped all of the line breaks.
J
@polarracing the line breaks come from the line breaks in the shortcode editor between the
[...]
tags (end of the[if]
etc). I don’t see a specific way to exclude those from output by using a variableForum: Plugins
In reply to: [Custom Content Shortcode] Heads up – Incompability with “Post Types Order”If prefer sort apply through the code, include ‘orderby’ =>’menu_order’ within custom query arguments, more details at http://www.nsp-code.com/sample-code-on-how-to-apply-the-sort-for-post-types-order-plugin/
is it possible to pass that to CCS shortcode?
I think there’s also a setting in the plugin settings that affects the queries?
Using the AutoSort option as ON you don’t need to worry about any code changes, the plugin will apply the customized post order on fly.
ie did you disable Autosort?
Hi @iantresman
No I tried that and it didn’t help
Again, if I don’t compress the html it’s fine because the browser ignores the whitespace.
However the html compressor (Fast Velocity Minify) strips the extra. I don’t think it can be normal spaces as it’d presumably only convert 1+ spaces to 1 space. Therefore it must be the line breaks between the
[format]
[if]
etc(Well more specifically a space followed by a line break seemingly will get removed entirely, since there’s no real reason to have a space before a line break. It’s not a fault of the compressor as such, it’s doing what it should do)
If I’m outputting the shortcode with PHP I can run a function to clean the output up manually, it’s just I need to apply this to every possible template field that might have a CCS shortcode in it.
Ideally therefore CCS would strip the line breaks between closing and opening
[...]
entries before creating it’s output. The only problem there is I guess in fact you might actually want those line breaks (auto formatting)I think therefore we could do with something like a
[spaceless]....[/spaceless]
tag or the[raw]
tag should do it? I’m just not sure on the use-cases regarding the latterForum: Plugins
In reply to: [Custom Content Shortcode] Greater than or equal to todayHi @polarracing
if it’s 2pm now but the published date was 9am this morning, will
future
include it?or does
future
mean “from this point onwards”?if it’s the latter can you do
today and future
thanks
Forum: Plugins
In reply to: [Custom Content Shortcode] Greater than or equal to todayfrom your docs
wp-admin/options-general.php?page=ccs_reference&tab=loop
it’s not detailed, but does
after=future
work?I’m guessing based on these 2 bits of info
Published Date: after - display posts after a date
and
Date Field: value - future: today and after
maybe they’re not connected though
- This reply was modified 4 years ago by codemonkeynorth.
Forum: Plugins
In reply to: [Custom Content Shortcode] Fatal error using [repeater]Flexible Content, Repeater and Gallery fields are all Pro features
https://www.advancedcustomfields.com/pro/would be better if those CCS shortcodes failed silently though, if the user does not have Pro.