Martin Robbins
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: 6.0 update strangely disrupts dreamhost mysql server?Looks like dreamhost got it straight within about 90 minutes.
Forum: Fixing WordPress
In reply to: Hook for user-edit.phpOne more possibility is to put a single checkbox on that page and a corresponding condition in the emailing function. So the email only gets sent if the box is checked. Everything else I wrote still applies.
Forum: Fixing WordPress
In reply to: Customizer error cheatin' uhYou are welcome
The customizer worked fine before,
Before what?
Perhaps before your user role got demoted or had capabilities removed?
Forum: Fixing WordPress
In reply to: Hook for user-edit.phpWhile viewing the user profile, you want to resend the exact same email that got sent when the user was created?
If so, don’t get hung up on the form, use a function. Use the exact same functions that sends the email in the first place.
And hook it to edit_user_profile (mail will be sent when you open the profile …
If you don’t want the mail sent until you click to update, hook it to profile_update …
The function you need very likely is wp_mail() … and you have to pass the proper parameters.
from the reference: http://codex.wordpress.org/Function_Reference/wp_mail<?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>Forum: Fixing WordPress
In reply to: A plugin or something to change admin bar widget customization url.I can’t stand that interface. I want it to go here: /wp-admin/widgets.php
+1
So I wrote the plugin and posted it here: http://wpmulti.org/admin-bar-widgets-link-no-customize/
Also another one to do the same thing with all 4 links that as of 4.2 go to the customizer instead of the “old-school” dashboard page. (themes, widgets, background, header): http://wpmulti.org/admin-bar-links-no-customize/
Forum: Fixing WordPress
In reply to: Editor under appearance is missing!I’ve seen this happen when the theme folder or file permissions are not set correctly. And the folder/files have become not writable by the server.
Forum: Fixing WordPress
In reply to: Hook for user-edit.phpfrom the reference: http://codex.wordpress.org/Function_Reference/wp_mail
<?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>It means to send email, you must have an email address, a subject line and a message. The header and attachment are optional.
You are editing a user on that page already so the user’s email address is known programatically.
Where is the subject line and the message you intend to send? Let me guess, you want to fill them out in your new form right? So why don’t you just add two new custom user-meta fields at the bottom of the form using the edit_user_profile hook and the reference instructions above? If so, at this point you would have a place to fill in the subject and message.
Then you could use the wp_mail function and hook it to profile_update …
(Runs when a user’s profile is updated. Action function argument: user ID.) The email would get sent when you save the user profile!Do you see what’s happening? I think you need two functions and two hooks. The first pair to create the new form fields, the second pair to send the email.
Forum: Fixing WordPress
In reply to: Hook for user-edit.phpSo what are the fields you need to generate the email?
Forum: Fixing WordPress
In reply to: Hook for user-edit.phpSorry, doesn’t really make much sense to me overall.
Maybe tell us more about the email content and who it goes to and when and why?
And why does its form have to be on the same page and inside the form already there which accomplishes readily its very specific purpose?
Forum: Fixing WordPress
In reply to: I'm not sure what voting on UserBase actually does or meansHow are you so certain the recent issue is not related to the past issue?
Do you recognize the name ethan close or ethan.close@gmail.com ?
Have you seen http://www.userbase.com or http://www.userbase.com/node/21653 or http://www.userbase.com/users/deek-speredelozzi ?
To me they seem to indicate deek speredelozzi somehow joined userbase.com 3 months ago …
Forum: Fixing WordPress
In reply to: I'm not sure what voting on UserBase actually does or meansYou are welcome
Is this maybe left over from the same topic you posted 5 months ago?
What is This “Join Our UserBase” Window That Won’t Stop Popping Up?
Forum: Fixing WordPress
In reply to: Login after changing hostYou are welcome
I’ve recently changed hosts, and I need to get some files that were stored on our WordPress back-end.
If your domain now points to the new host, to get files from the old host, you will have to login to your old host via whatever their control panel.
Forum: Fixing WordPress
In reply to: Hook for user-edit.phpIsn’t the whole page already one form? Are you sure you want to insert a second form within the form? Maybe you just want some additional fields within the existing form?? If so do they have to be at the top? Or would it be OK if they were at the bottom?
Sorry for all the questions. If that all makes sense, I think you were on the right track with
edit_user_profilehttp://codex.wordpress.org/Plugin_API/Action_Reference/edit_user_profile
Example:/** * Show custom user profile fields * @param obj $user The user object. * @return void */ function numediaweb_custom_user_profile_fields($user) { ?> <table class="form-table"> <tr> <th> <label for="tc_location"><?php _e('Location'); ?></label> </th> <td> <input type="text" name="tc_location" id="tc_location" value="<?php echo esc_attr( get_the_author_meta( 'tc_location', $user->ID ) ); ?>" class="regular-text" /> <br><span class="description"><?php _e('Your location.', 'travelcat'); ?></span> </td> </tr> <tr> <th> <label for="tc_favorites"><?php _e('Favorites', 'travelcat'); ?></label> </th> <td> <input type="text" name="tc_favorites" id="tc_favorites" value="<?php echo esc_attr( get_the_author_meta( 'tc_favorites', $user->ID ) ); ?>" class="regular-text" /> <br><span class="description"><?php _e('Can you share a few of your favorite places to be or to stay?', 'travelcat'); ?></span> <br><span class="description"><?php _e('Separate by commas.', 'travelcat'); ?></span> </td> </tr> <tr> <th> <label for="tc_travel_map"><?php _e('Travel map', 'travelcat'); ?></label> </th> <td> <input type="text" name="tc_travel_map" id="tc_travel_map" value="<?php echo esc_attr( get_the_author_meta( 'tc_travel_map', $user->ID ) ); ?>" class="regular-text" /> <br><span class="description"><?php _e('Been there / Going there within a year / Wish list.', 'travelcat'); ?></span> <br><span class="description"><?php _e('Separate by commas.', 'travelcat'); ?></span> </td> </tr> </table> <?php } add_action('show_user_profile', 'numediaweb_custom_user_profile_fields'); add_action('edit_user_profile', 'numediaweb_custom_user_profile_fields');Forum: Hacks
In reply to: Delete Old Thumbnail Images?I think you can use this plugin after you have deregistered the image sizes you want to get rid of.
https://wordpress.org/plugins/regenerate-thumbnails/
http://codex.wordpress.org/Function_Reference/remove_image_size
http://codex.wordpress.org/Function_Reference/add_image_size
Forum: Hacks
In reply to: Search to show full postFor the search not to show excerpt, Have you tried it like this?
<?php if ( is_home() || is_archive() ) :// Only display Excerpts for Home, and Archives ?> <div class="entry-summary"> <?php the_excerpt(); ?> <a href="<?php echo get_permalink(); ?>" >Read More →</a> </div><!-- .entry-summary -->It still depends on what comes aftermard in the rest of the file, it will only show the full post if afterward is
the_content();This is the code to display the featured image:
<?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail(); ?> </a> <?php endif; ?>So put it all together it’s like this:
<?php if ( is_home() || is_archive() ) :// Only display Excerpts for Home, and Archives ?> <div class="entry-summary"> <?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail(); ?> </a> <?php endif; ?> <?php the_excerpt(); ?> <a href="<?php echo get_permalink(); ?>" >Read More →</a> </div><!-- .entry-summary -->One other thing, the read more tag might prevent the above code from working right.