diondkb
Forum Replies Created
-
Hi Andrew,
As stated above, they do not have an entry in the wp_pmpro_memberships_users table and thus their entry in the wp_pmpro_membership_orders table does not have a user_id value. I have to keep doing this manually!
Hi Andrew. Not sure where you found that function – pmpro_shortcode_account. I thought the idea behind this all is to replace the original file – pmpro-account.php, or pmpro-checkout.php etc with your file of the same name, but with your changes, saved in the template folder off of the pmpro-customizations sub directory. This is how I understand this link – https://www.paidmembershipspro.com/documentation/templates/customizing-via-a-custom-plugin/
Hi,
Thanks for the reply. I think the problem is that pmpro_account.php contains the function pmpro_shortcode_account() which at that stage has already been loaded. Its as if the included file(in the customisation plugin), “plugin_dir_path(__FILE__) . “templates/pmpro_account.php” is loaded twice, the first being the original and the second time the one I have adjusted?
Thanks. So If I want to allow existing customers to change levels using one click, I would just add the url linked to the change link, to a designated button?
Forum: Plugins
In reply to: [Theme My Login] Humanity not working?Hi,
Sorry my fault.
Sorry. Input error. The url I referred to above is – http://www.paidmembershipspro.com/add-ons/free-add-ons/pmpro-register-helper-add-checkout-and-profile-fields/adding-fields/
Forum: Hacks
In reply to: Preg_replace not workingHi,
If the line of text ends in ‘.mp3″]’, then don’t do the replacement. So,
[html5_audio src="https://s3.amazonaws.com/sfs-premium/collection/Rider+Aids/Seat+Aids+and+Feel/Learning+How+to+Stop+Driving+with+Your+Seat/686-Learning-to-Stop-Driving-with-Your-Seat.mp3"]… would not change, while
<audio src="https://s3.amazonaws.com/sfs-premium/collection/Rider+Aids/Seat+Aids+and+Feel/Learning+How+to+Stop+Driving+with+Your+Seat/686-Learning-to-Stop-Driving-with-Your-Seat.mp3" />would be changed to look like this
<audio src="https://s3.amazonaws.com/sfs-premium/collection/Rider+Aids/Seat+Aids+and+Feel/Learning+How+to+Stop+Driving+with+Your+Seat/686-Learning-to-Stop-Driving-with-Your-Seat.mp3?name=[current_user]"Also, if the ‘?name=’ string comes immediately after the ‘.mp3’ not substitution is necessary.
Hope this makes sense.
Forum: Hacks
In reply to: Preg_replace not workingsorry. got the tags a little mixed up.
Forum: Hacks
In reply to: Preg_replace not workingThanks for your patience. I changed the shortcode as requested with no change-
function add_user_to_mp3( $content ) { return preg_replace('/\.mp3(?!\?name)(?!"])/', '.mp3?name=[current_user]', $content ); } add_filter( 'content_save_pre' , 'add_user_to_mp3' , 10, 1); After editing the page containing the shortcode in the wordpress editor, and adding this code and then saving, the code changes from this:</div>
to this:</div>
[html5_audio src=”https://s3.amazonaws.com/sfs-premium/collection/Rider+Aids/Seat+Aids+and+Feel/Learning+How+to+Stop+Driving+with+Your+Seat/686-Learning-to-Stop-Driving-with-Your-Seat.mp3?name=%5Bcurrent_user%5D”%5D
`
I copied the exact same preg_replace pattern(‘/\.mp3(?!\?name)(?!”])/’) from the shortcode function(which at this point does not seem to work) and pasted it in the web page mentioned previously and did a hard refresh and the pattern behaves as expected ie not doing the replacement(‘.mp3?name=[current_user]’)?Any ideas I can try. Thanks
Forum: Hacks
In reply to: Preg_replace not workingI stuck the same piece of code into one of my web pages and got the correct output-
<?php echo preg_replace('/\.mp3(?!\?name)(?!"])/', '.mp3?name=[current_user]', '[html5_audio src="https://s3.amazonaws.com/sfs- premium/collection/Rider+Aids/Seat+Aids+and+Feel/Learning+How+to+Stop+Driving+with+Your+Seat/686-Learning-to-Stop-Driving-with-Your-Seat.mp3"]' ); ?>preg_replace does not seem to work correctly in the context of a shortcode?
Forum: Hacks
In reply to: Preg_replace not workingHere is the code(placed in a shortcode)
function add_user_to_mp3( $content ) { return preg_replace('\.mp3(?!\?name)(?!"])', '.mp3?name=[current_user]', $content ); } add_filter( 'content_save_pre' , 'add_user_to_mp3' , 10, 1);When I refresh the web page, I get the following error –
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash inForum: Hacks
In reply to: Preg_replace not workingHi. Not according to this example…
<?php $string = 'April 15, 2003'; $pattern = '/(\w+) (\d+), (\d+)/i'; $replacement = '${1}1,$3'; echo preg_replace($pattern, $replacement, $string); ?>…found here http://php.net/manual/en/function.preg-replace.php
Forum: Hacks
In reply to: Shortcode not being evaluated when enclosed in audio componentThanks
Forum: Hacks
In reply to: Shortcode not being evaluated when enclosed in audio componentHi bcworkz,
I tried the above code, but was not sure if the filter was fired. Is there a way other than using an alert in the short code function to tell me it fired? Failing which, I guess I will create a new shortcode which will return the entire html for audio with the attributes adjusted.
Cheers,
dionThank you.