Adding tags to Status Plugin

Hello, Just purchased WPMU Status Plugin to enable Front-end posting. Could you please help me configure tags functionality to the status update? Thank you!

    lauren_gibbons8
    • 4
    • #17,863

    Ok, I figured it out with the help of this post http://www.cozmoslabs.com/5528-wordpress-post-from-front-end/

    dashboard-widget.php
    <p><label>Tags: </label><input id="fep-tags" name="tags" type="text" tabindex="2" autocomplete="off" value="<?php esc_attr_e( 'Add tags', 'simple-fep' ); ?>" onfocus="this.value=(this.value=='<?php echo esc_js( __( 'Add tags', 'simple-fep' ) ); ?>') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php echo esc_js( __( 'Add tags', 'simple-fep' ) ); ?>' : this.value;" /></p>

    I wasn't sure where to put the simple-fep function so I just installed the plugin.

    class_wdqs_admin_pages.php

    function create_post ($data) {
    		//if (!current_user_can('publish_posts')) return false;
    		if (!$this->_check_permissions()) return false;
    		global $user_ID;
    		$send = array(
    			'image' => $data['thumbnail'],
    			'no_image' => (int)$data['no_thumbnail'],
    			'height' => (int)$data['height'],
    			'width' => (int)$data['width'],
    			'link_title' => @$data['link_title'],
    			'link_text' => @$data['link_text'],
    		);
    		$text = $this->generate_preview_html($data['data'], $send, true);
    		$title = @$data['title'] ? $data['title'] : $this->_get_default_title();
    		$category = $this->data->get('post_category-' . $this->_link_type);
    		$tags = @$_POST['tags'];
    		$post = array (
    			'post_title' => $title,
    			'post_content' => $text,
    			'post_date' => current_time('mysql'),
    			'post_status' => @$_POST['is_draft'] ? 'draft' : (current_user_can("publish_posts") ? 'publish' : 'pending'),
    			'post_author' => $user_ID,
    			'post_category' => array($category),
    			'tags_input'	=> $tags,
    		);

    widget.js

    var title = $("#wdqs-post-title").length ? $("#wdqs-post-title").val() : '';
    	var tags = $("#fep-tags").length ? $("#fep-tags").val() : '';
    	var thumbnail = ($(".wdqs-image-list li:visible:first").length) ? $(".wdqs-image-list li:visible:first img").attr("src") : '';
    	var no_thumbnail = ($("#wdqs-no-thumbnail").length && $("#wdqs-no-thumbnail").is(":checked")) ? 1 : 0;
    	var height = $("#wdqs-height").length ? $("#wdqs-height").val() : 0;
    	var width = $("#wdqs-width").length ? $("#wdqs-width").val() : 0;
    
    	var link_title = $(".wdqs-title-container h3 a").text();
    	var link_text = $(".wdqs-text-container p").html();
    
    	var is_draft = $(e.target).is("#wdqs-draft") ? 1 : 0;
    
    	var $root = $("#wdqs-dashboard-widget").parent();
    	$root.html('<div class="wdqs-waiting-for-response"></div>');
    
    	$.post(_wdqs_ajaxurl, {
    		"action": "wdqs_post",
    		"is_draft": is_draft,
    		"data": text,
    		"title": title,
    		"tags": tags,
    		"height": height,
    		"width": width,
    		"thumbnail": thumbnail,
    		"no_thumbnail": no_thumbnail,
    		"link_title": link_title,
    		"link_text": link_text
    	},
    function callPreviewUpdate () {
    	var title = $("#wdqs-post-title").length ? $("#wdqs-post-title").val() : '';
    	var tags = $("#fep-tags").length ? $("#fep-tags").val() : '';
    	var text = $("#wdqs-status").val();
    	var height = $("#wdqs-height").length ? $("#wdqs-height").val() : 0;
    	var width = $("#wdqs-width").length ? $("#wdqs-width").val() : 0;
    
    	$("#wdqs-preview-root").html('<div class="wdqs-waiting-for-response"></div>');
    	$.post(_wdqs_ajaxurl, {
    		"action": "wdqs_generate_preview",
    		"text": text,
    		"title": title,
    		"tags": tags,
    		"height": height,
    		"width": width
    	}

    Perhaps that will help someone. Apologies for dirty copy & paste. Also, I'm sure there is a better way to do that...

    Timothy

    Hey there.

    Thanks for sharing the link and code you used, perhaps it might helps others looking for the same/similar thing. :)

    Take care.

    murratw
    • 9
    • #10,923

    Can you give more detail on how to enable this. It would really help me.

    Timothy

    Hey there.

    If you're unable to follow the code suggestions here and on the other site linked to, then unfortunately you'll need to hire a developer to code that up for you.

    As it's a relatively small job you could look at either:

    http://premium.wpmudev.org/wpmu-jobs

    Or

    https://www.tweaky.com/

    Tweaky specialise in smaller edits.

    Take care.

Join 366163 happy members

Get access to our entire collection of epic plugins, astonishing themes & genius support

Become a member