Tag Info

Hot answers tagged

8

you got the first part right about using personal_options_update but to be on the safe side add edit_user_profile_update also. and as for sending emails within WordPress the best way would be to use wp_mail, So something like this: add_action( 'personal_options_update', 'notify_admin_on_update' ); add_action( ...


7

I just found a solution as an automated service over at http://de.wpseek.com/pluginfilecheck/ It's does exactly, what was asked for including the generation of list of used functions and giving a suggestion for the Plugin-Header comments.


5

I was inspired by your question to create a plugin that I've been kicking the can on for several months. I'm calling it Deprecation Checker. By default, it scans the plugin and theme directories (recursively) to find deprecated functions. The functions list is sourced directly from the WP deprecated files. It then outputs a nice list including line number, ...


5

Use the save_post action to run some code when a new show is created, then use wp_insert_post to create your child pages. Here's an example to get you started - First, filter out any saves that are auto-saves, post revisions, auto-drafts, and other post types. Once you know it's your show type, you can check if it has a parent to filter out saves of your ...


3

Well, it seems like the answer is "No, there's isn't an existing solution for this." If anyone wanted to write one, these might be helpful: The general process described in the question http://wordpress.org/extend/plugins/deprecation-checker/ http://wordpress.org/extend/plugins/log-deprecated-notices/ http://adambrown.info/p/wp_hooks/hook ...


3

set_post_thumbnail will allow to set 1 attachment from id to a post of provided id. If you don't have the attachment id or want to do it directly from url, you will have to create the attachment first, see wp_insert_attachment you may also upload the image using media_sideload_image


3

You can use wp_insert_attachment() and wp_generate_attachment_metadata() to make the image an attachment to the post. And you make it a featured image by using set_post_thumbnail(). (it's really just a custom field _thumbnail_id. Something like: $attach_id = wp_insert_attachment( $attachment, $filename, $post_id ); $attach_data = ...


3

Ehm, Theme Check plugin? :) It is set up for themes, but easy enough to make use of parts: require WP_PLUGIN_DIR . '/theme-check/checkbase.php'; $check = new Deprecated(); $path = 'c:\server\www\dev\wp-content\plugins\deprecated.php'; $files = array( $path => php_strip_whitespace( $path ) ); $check->check( $files, array(), array() ); var_dump( ...


2

Well, the longest bit is going to be getting together a list of all the deprecated functions. Wordpress.org has a page for it here, but since that may or may not be current I would suggest going through the 5 listed files and searching for "function" to get a better list. Once you have the list together in a text file (one function name per line), put that ...


2

You can use the CSV Importer plugin to import your spreadsheet into posts or even better a custom post type say "school" import school name as post title and the rest as custom fields. Then create a single-school.php file in your theme directory and pull out the name and other fields and you are done. Each school will have Its own page


2

Well, this is more of a starting point, but there is this nice list of WP functions and the versions they were added/removed here. Unfortunately, it only goes up to WP 3.0.1, but if you're shooting for 3.0 as a baseline it will at least help - if it's not in the list, it was added later. You might want to email Ozh and ask him to update the list, and if ...


2

I am not sure what answer you are looking for. Plugins are not something that you directly see when you look at site. Not something site's reputation is based on. I hadn't looked into this specific plugin, but as any of this kind it likely can be used both for perfectly legit and absolutely spammy purposes.


2

I have a feeling that there is information missing from this question but the obvious answer is to schedule your posts with the built in post publication scheduler.


2

I did something similar a while ago. I'm not sure deleting a post is a good solution, maybe you can change only the post status to a custom one called Expired for example. But for an example, the code below will delete the post. First create a daily cron job: add_action( 'wp', 'delete_expired_coupons_daily' ); function delete_expired_coupons_daily() { ...


2

Try using set_post_thumbnail(). Assuming you already know how to determine the $post (ID or object) for which to set the featured image, and the $thumbnail_id (ID) of the image that you want to set as the featured image: set_post_thumbnail( $post, $thumbnail_id );


1

First off, it sounds like you might be able to solve your underlying question using BuddyPress. If you simply want to make an actual WordPress page if a user registers you can do that using the user_register hook. The hook receives the newly created user ID. This code example should create a page with the user's nicename. add_action( 'user_register', ...


1

Playing with XML-RPC and underscored custom fields: Let's say we want to set the featured image to a given post with $remote_post_id. We want it to be the attachment with ID equal to 300, so we want _thumbnail_id to be 300. Here are three methods how one could achieve that: Method #1 - Using post_thumbnail It's possible to update/add the featured image ...


1

_Underscored meta data is defined to be data which is internal to the software and not directly changed by a user. This is probably why you can't change it via XMLRPC. If you need this kind of functionality you can write a small plugin that extends the set of data you can change with XMLRPC. But Since you question is specifically about featured images you ...


1

There is no clean solution to this, because task is, well, dirty. :) You should really be making these modifications in a proper ways. If I absolutely had to do this (and even than probably for specific plugin and not at scale), I would look into maintaining my changes as vendor branch in version control and rebase on top of new releases. Even then it's not ...


1

Here is one idea: You could try to fire the change event of the #location-address (for example) input text field when the page has loaded: function custom_jquery() { echo "<script>jQuery(document).ready(function(){ jQuery('#location-address').on( 'change', function( event ) { console.log('debug: on change fired!'); ...


1

The answer was right under my nose facepalm. In the custom field suite plugin, instead of entering ProductName-2000 : ProductName-2000 you enter <a href="http://www.site.com/ProductName-2000/">ProductName-2000</a> : ProductName-2000 I kinda wish i could delete this question... hope it helps someone else at least. :P


1

Can't really see why should be seen as spam. All depends on you and how you are using it. It's like all car drivers will be seen as suiciders because one hitted a tree in purpose :)


1

If you are using WP Robot to create some spammy blog that merely aggregates junk content from other peoples blogs then I would see it as being misused by whoever set up the blog, in this case it would be you. Not all content aggregation / auto posting plugins are used for spam. I've used a couple before to aggregate content from credible websites for a ...


1

While importing from machine-readable formats, such as RSS is quite straightforward and usually has plenty of tools around... it is very different story with arbitrary HTML. If you are not up to code this from scratch, then closest semi-automated tool I know is Dapper - it can process HTML pages and according to rules that you setup in visual interface ...


1

If you use WP Robot too much your blog will be seen as a bot or scraper site. I would rather mix the automatically created content with handwritten one then set it to autopilot. The trick is to use the features of WP Robot to minimize your work and maximise the worth for the reader. And yes: Automation plugins are almost always seen as something "blackhat".


1

I've created a very basic plugin for that now. Let me know what you think or if you have any questions.


1

Here's a modified version building on the work from others, here. This instance sends an email if the user's email field has been changed. Swap 'user_email' with whatever user meta you like. add_action( 'personal_options_update', 'notify_admin_on_update' ); add_action( 'edit_user_profile_update','notify_admin_on_update'); function notify_admin_on_update(){ ...


1

You'll want to hook into wpmu_new_blog. You can see the args you can pass it here (no codex right now...). That last $meta arg can take a lot of different settings. You also might look into the WPMU New Blog Defaults. It doesn't seem to do everything you want, but it might at least contain some good examples for how to use that hook.


1

Like Bainternet suggested - remove_meta_box( 'tagsdiv-custom_taxonomy_id', 'post', 'side' ); to remove the default Metabox. If you want to still see the terms. Then re-register the metabox with your own custom callback. This callback function can then mimic the function used to display the default metabox - but simply omitting any input forms /checkboxes ...


1

Use the XML-RPC API to post to your blog. Windows Live Writer and other apps are using that too. I am not very familiar with that API, so I have no good examples. But you should find enough with the keyword. There are also many plugins with sample code.



Only top voted, non community-wiki answers of a minimum length are eligible