Đang Thực Hiện

Wordpress postie plugin - modify filter [[url removed, login to view]]

I have a new wordpress blog and am using the postie plugin to allow posting of content via email

The plugin works great. I can email to an address and it's posted to the default category set in postie.

This all works fine.

But- Postie has a filter option which allows you to set the category with a tag in the submitted email.

I'm not a php wiz, and its a bit greek to me.

I just need someone to modify the filter file (the file is below) so that it will assign incoming email/posts to a category.

I assume the sender of the message will add a tag to the subject or the body (either way).

Project should be basic PHP programming for someone who can deal with Wordpress Plugins and functions. I simply don't have the time to do this, and need this ASAP.

A couple examples you could add to the filter below:

[press-releases]

[recent-news]

[blog]

I'll just need the text below returned, then I test on the already working postie setup.

Thanks

--- this is the sample filter file ----

<?php

/*

Plugin Name: Postie Filter

Plugin URI: [url removed, login to view]

Description: Adds my own custom filter to messages posted by postie

Version: 1.4

Author: Robert Felty

Author URI: [url removed, login to view]

*/

/*

* Any filter function you write should accept one argument, which is the post

array, which contains the following fields:

'post_author'

'comment_author'

'comment_author_url'

'user_ID'

'email_author'

'post_date'

'post_date_gmt'

'post_content'

'post_title'

'post_modified'

'post_modified_gmt'

'ping_status'

'post_category'

'tags_input'

'comment_status'

'post_name'

'post_excerpt'

'ID'

'customImages'

'post_status'

Your function can modify any of these fields. It should then return the array

back.

Two example functions are provided here

*/

function filter_content($post) {

//this function prepends a link to bookmark the category of the post

$this_cat = get_the_category($post['ID']);

//var_dump($this_cat);

$link = '<a href="' . get_category_link($this_cat[0]->term_id) .

'">Bookmark this category</a>' . "\n";

$post['post_content'] = $link . $post['post_content'];

return ($post);

}

function filter_title($post) {

//this function appends "(via postie)" to the title (subject)

$post['post_title']= $post['post_title'] . ' (via postie)';

return ($post);

}

function auto_tag($post) {

// this function automatically inserts tags for a post

$my_tags=array('cooking', 'latex', 'wordpress');

foreach ($my_tags as $my_tag) {

if (stripos($post['post_content'], $my_tag)!==false)

array_push($post['tags_input'], $my_tag);

}

return ($post);

}

function add_custom_field($post) {

//this function appends "(via postie)" to the title (subject)

add_post_meta($post['ID'], 'postie', 'postie');

return ($post);

}

add_filter('postie_post', 'filter_title');

add_filter('postie_post', 'filter_content');

add_filter('postie_post', 'add_custom_field');

add_filter('postie_post', 'auto_tag');

?>

Kỹ năng: PHP

Xem thêm: postie filter file, wordpress postie filter sample, postie filter, filter postie category, wordpress postie custom fields, wordpress postie filter, postie filter functions, postie post filter, postie category content, wordpress postie custom filter, postie add tags post, filterpostie, plugin postie custom, write name body, wordpress php programming, wordpress greek, wordpress email plugin, test wordpress, subject php, programming via php, press plugin, php wordpress programming, php tags, php programming wordpress, php programming test

Về Bên Thuê:
( 0 nhận xét ) Land O Lakes, United States

Mã Dự Án: #1067744

Đã trao cho:

sachin00700

Sir check your PMB

$60 USD trong 2 ngày
(0 Đánh Giá)
0.0