cncup
Forum Replies Created
-
Thanks Mircea. Lucky you explained or I wouldn’t have known why my homepage check isn’t working. I resorted to using php’s $_SERVER and a check against the site url. It works.
Thanks for the references too. Much appreciated.
Hi Mircea,
Thank you for the reply.
Yes it works in “Run Everywhere” when I also remove the condition “Type of page is Homepage”. Initially when setting the condition, the plugin changes the location automatically to “Frontend Conditional Logic”. It allows to change it back to “Run Everywhere” while the condition is still on, but apparently treats it underneath as “Frontend Conditional Logic”, hence the filter code doesn’t work as long as the condition is there.
I can do without the condition and check in the code if it’s homepage, no problem. Just to know in general, is there a way to have the condition and also “Run Everywhere”? Not what is shown as saved but underneath truly.
Thanks.
Forum: Plugins
In reply to: [WP24 Domain Check] Link to marketplace + the use-case of “Transfer”Turns out the ‘text’ value already holds the whois record. I thought it was holding the link text. Apologies for not checking before.
Forum: Plugins
In reply to: [WP24 Domain Check] Link to marketplace + the use-case of “Transfer”It helps. Much appreciated.
So I guess I can make use of the wp24_domaincheck_whois_result hook to check the result domains against a marketplace API and show links accordingly. As you say it might be a lengthy operation in case of multiple marketplaces.
I haven’t tried the hook yet – I see in the doc page that the array keys correspond nicely to the output: domain, tld, status, text, price, link.
If the array was holding also data from the whois record it would allow handling the results in creative ways.
Keys like:
– registrar
– nameservers
– creation/expiration dates
For example when a domain is registered at a registrar I’m affiliated with, I could show “Registered at [registrar]” and link to a relevant page at that registrar.
Even name and email that are normally hidden in the whois can come in handy in some cases/TLDs.
And, in case the fetching of whois data might burden the search operation, there could be a setting like ‘Enable whois data in hook’ that is false by default.Would it be possible to make it a feature request? I can open a separate thread if needed.
Thanks.
Forum: Plugins
In reply to: [WP24 Domain Check] Link to marketplace + the use-case of “Transfer”No answer?
Thanks Ralden.
I can understand why this is outside the scope for support. It’s a bit involved and specific to one’s case.
For future reference, I solved it with wpforms_field_properties filter. The sorting is prepared in an array beforehand without involving the form.
add_filter( 'wpforms_field_properties', function( $properties, $field, $form_data ) { // Only process for the relevant form and field. Change these values to match your form and field id's. if ( !( absint( $form_data[ 'id' ] ) === 2032 && absint( $field[ 'id' ] ) === 8 ) ) return $properties; $items = [ 999=>"Peach", 200=>"Apple", 535=>"Cherry" ]; // This is created dynamically per the order logic. $items_count = count( $items ); // Set items' keys and values to checkboxes. if ( $items_count === count( $properties['inputs'] ) ) { // Make sure the inputs count matches the items'. for ( $i = 0; $i < $items_count; $i++ ) { $ids = array_keys( $items ); $properties[ 'inputs' ][ $i ][ 'label' ][ 'text' ] = $items[ $ids[ $i ] ]; $properties[ 'inputs' ][ $i ][ 'attr' ][ 'value' ] = $ids[ $i ]; // Array keys are checkbox values. } } return $properties; }, 10, 3 );You’d still need to set the $args[ ‘include’ ] in the wpforms_dynamic_choice_post_type_args filter as shown in the OP, not for the specific values but for the count. If you need it dynamic.
You can print out the $properties object to see its structure:
echo "<pre>" . print_r( $properties, true ) . "</pre>";I hope this comes in handy for someone.
Forum: Plugins
In reply to: [Bulk Media Register] How to disable ‘results sent via email’?Hi, I see a setting was added in the new update. Thanks for the quick response. Appreciated!
Custom, external, same thing. The doc you linked says in the comment above the code “Writes additional/custom XML sitemap”.
And I’m ahead of this example, it uses hard coded values. The link I provided shows a way to get the values dynamically, and the question was about that.
So I infer from the A being two steps behind the Q and the ongoing lack of a direct reply that there is no simpler way.
The issue can be closed.
All the best
It seems I’m not getting through for the second time. The question is NOT about canonical.
It’s about adding custom sitemap, dynamically.
For future reference, what I tried with the link I provided earlier worked. Credit and thanks to leepowers on GitHub.
Still would be nice to know if there is a simpler way to do it.
Third time’s the charm?
Hi @maybellyne.
Thank you for your reply.
Yes, this is why I mentioned the wpseo_canonical filter. I’m changing the canonical, so the canonical for a parameterized URL is itself.
(removing ‘garbage’ params to avoid duplicates)I came across the wpseo_sitemap_index filter. The implementation is a bit involved if I want the sitemap-addition to be all the way dynamic. There is this code on github that I will try to modify to my needs. But that would be the way to go, right?
Or is there a simpler way?
Oh I see now. The variable has to be defined as global also outside the function. Which was probably what you meant I suppose.
So simply adding the global definition before the assignment:
global $some_var; $some_var = 'one'; function shortcode_func() { global $some_var; ... }And it works.
Thanks!
All that I did. The variable is defined as global in the first snippet. I played exhaustively with the Priority field. It changed nothing.
Please note the example I gave here is of one snippet. The global variable doesn’t work even in the context of one snippet alone.
Thanks. I created a bug report.
If anyone can chime in, would be swell.
Just to clarify I’m referring to the drop down part of the list view. Items selected before the limit is reached continue to show after the limit is reached. But the drop down is now empty, so you can’t add to the selection.
It’s a rather strange behavior that seems more like a bug than by-design.