18

Well, Thanks to wp 3.3 now we have wp_editor() function to do that :)


11

Its Not has hard as you think it is :) Add the password fields to your form : password: <input type="password" name="pass1" style="width:250px; margin-bottom:3px;"><br /> repeat password: <input type="password" name="pass2" style="width:250px; margin-bottom:3px;"><br /> then in your if($_POST){ replace this line: $random_password ...


10

Here is a basic solutions for updating a post/page. I added a quick demo of custom meta fields. This is pretty basic, but will point you in the direction of plugin-less editing of posts on the front-end. This isn't super flexible, but you can add whatever you need to it. Add this code into your loop: <form id="post" class="post-edit front-end-form" ...


10

If you are willing to pay for it, the Gravity Forms plugin allows you to create forms that map to your Custom Post Types (even regular post and page - types) as well as map to your custom fields. For those who aren't and who are willing to roll up their sleeves then you can create a front end form that posts data into any post type of your choosing quite ...


10

I just ran into this issue as well, the cause of this is that at 600 pixels wide the admin bar goes from being position:fixed to position:absolute; When fixed, it is locked to the top of the screen (top:0) When absolute it is locked to the top of the closest container that contains it. This is the html element by default, but if a parent is defined to have ...


9

I use Advanced Custom Fields for lots of front end post editing with meta boxes. ACF allows you to build lots of advanced meta box fields and adds them automatically to the back end post panel. But there is a front end function as well. This method is completely free. The only way it costs anything is if you want to use any of their more complex field type ...


9

If you don't need wp_editor in front-end, I think its OK. Here a little bit different option settings with your tinymce init. I use this without wp_editor in front-end. <script> jQuery( document ).ready( function( $ ) { tinymce.init( { mode : "exact", elements : 'pre-details', theme: "modern", skin: "lightgray", ...


8

WordPress handles login failed in two ways: If it is a bad credential, and both username and password have a value, then this action can be captured by wp_login_failed If both, or one, of the options are empty, then WordPress generates the error object as the first parameter in the authenticate filter; it does not open and wp_login_failed action captures ...


8

You're supposed to enqueue on the wp_enqueue_scripts event. Placing the function in functions.php and immediately running it, will make it run on all pages, including the admin area Here's an example from the devhub: /** * Proper way to enqueue scripts and styles. */ function wpdocs_theme_name_scripts() { wp_enqueue_style( 'style-name', ...


7

You can combine add_action() and an is_admin() check: ! is_admin() and add_action( 'init', 'my_custom_callback' ); Now the callback function will run on front-end only.


7

There are a few functions that come in handy here: unstick_post - Unstick a post stick_post - Stick a post is_sticky - Figure out if a post is sticky With those three in mind, all we need to do is stick them together with some admin menu bar glue. First off, let's wrap everything in a class for fun and profit. This class will have some constants that we'...


7

you can do that by running the function set_post_thumbnail( $my_post_id, $thumbnail_id ); remember, you have to process and insert the image into the library first: $uploaddir = wp_upload_dir(); $file = $_FILES[ ... whatever you have in your POST data ... ]; $uploadfile = $uploaddir['path'] . '/' . basename( $file ); move_uploaded_file( $file , $...


6

I actually wrote this for Happy Tables so should be able to give you a couple of pointers, though I don't have time to go into too much depth at the moment. We use this "image well" on tables tables a fair bit, it's basically the drag/drop upload from the WordPress upload. Similar to something like this: https://github.com/tobiasnygren/Drag-Drop-for-Post-...


6

Use the following code inside just before tag on your front end code. wp_nonce_field('name_of_your_action', 'name_of_your_nonce_field'); The above code will generate two hidden inputs inside your form tag. Now you can verify your nonce in the backend where you will process your form. Use the following code to verify the nonce you just created above. if(...


6

There is no such action in the front end (in a theme) by default. Simply use a custom action like do_action( 'theme_notices' ); and hook into this one.


6

Here is my solution: add_filter('the_editor_content', "firmasite_tinymce_style"); function firmasite_tinymce_style($content) { add_editor_style('assets/css/custom.css'); // This is for front-end tinymce customization if ( ! is_admin() ) { global $editor_styles; $editor_styles = (array) $editor_styles; $stylesheet = (...


6

The WordPress function get_the_modified_author() will give you the author who last edited the current post. But if you want to list all the users that have edit the current post, you could try: function get_the_modified_authors_wpse_99226(){ global $wpdb; $authors = array(); $results = $wpdb->get_results( $wpdb->prepare("SELECT ...


6

A simple user meta row can handle that for you (the second issue), you can store the post id and the vote (up/down) in an array and that is just the same as post meta ex /** * update user vote per post * @param int $user_id * @param int $post_id * @param mixed $vote can be an integer 1 / -1 and can also be a string "up"/"down" * @return void */ ...


6

Use following code to achieve your requirement. //hook when user registers add_action( 'user_register', 'myplugin_registration_save', 10, 1 ); function myplugin_registration_save( $user_id ) { // insert meta that user not logged in first time update_user_meta($user_id, 'prefix_first_login', '1'); } // hook when user logs in add_action('wp_login',...


6

Hi You have Use this COde For WordPress front-end AJAX file upload tutorial Code Here is my code: In my template file example.php <form enctype="multipart/form-data"> <input type="text" name="support_title" class="support-title"> <input type="file" id="sortpicture" name="upload"> <input class="save-support" name="save_support" ...


6

By Killing WP on non-admin Pages The below code will determine whether you are on a front-end page or not, and kill WP if you are. add_action( 'init', 'my_function' ); function my_function(){ if ( ! is_admin() ) wp_die(); } Note that this might also affect AJAX requests ( untested ) so you might want to add wp_doing_ajax() to your conditional too. ...


5

It is really not best practice to do it this way at all. In fact you don't need to create an ajax.php file unless you're just going to include it in your functions.php file. You need to read up on AJAX in WordPress. You would just add an action on 'wp_ajax_name_of_action' and just specify the action within the javascript ajax function. Simple example ...


5

The easiest way would be to use something like Ninja Forms with the following paid extension: http://wpninjas.com/downloads/front-end-posting/ You could also code this yourself. Essentially you'll create a form, and then use wp_insert_post() to create a full post. A sample form: <form action="" id="primaryPostForm" method="POST"> <fieldset&...


5

I wanted to provide you with a few ideas but once I started I couldn't stop myself and wrote this little plugin with an obscure name to get you started. <?php /* Plugin Name: WPSE Crowded Cats Plugin URI: http://wordpress.stackexchange.com/questions/43419/how-do-i-create-a-way-for-users-to-assign-categories-to-a-post-from-the-frontend Description: Allow ...


5

WordPress sets is_admin() to true for all ajax requests (front-end or admin-side). (See codex). There's isn't away of over-riding this (and you shouldn't anyway). If your ajax request can be fired from both front-end and admin side, then you may want to include whether it 'is admin' or not when you post the data. But without any details on the 'issues' it ...


5

The WP User Frontend plugin will meet all your needs. You can find the plugin here: https://wordpress.org/extend/plugins/wp-user-frontend/. The plugin gives ability to the user to create new post, edit post, edit profile from site frontend. So users doesn't need to enter the admin panel. Everything they need to do can be done from the frontend. If you do a ...


5

Another option would be to set a 301 redirect for all the slideshow CPTs to redirect somewhere (like the home page). This would get picked up by Google, and also make sure no one accidentally gets on them function rkv_slideshow_redirect() { global $wp_query; // redirect from 'slideshow' CPT to home page if ( is_archive('CPT_NAME_HERE') || ...


5

Use esc_url( $url ) for URLs that should be displayed and esc_url_raw( $url ) if the URL should be sent to the database. The first will replace bare ampersands & with &#038;. The second is a wrapper for the first; it will just suppress the escaping of ampersands. Both functions will check the protocol. See wp_allowed_protocols() for the list: '...


5

There's a global variable called $wp_scripts which is an instance of the WP_Scripts class. It doesn't have a public API for looking at registered or enqueued scripts, but you can look inside the object and see what's going on. You can see all the registered scripts with: global $wp_scripts; var_dump( $wp_scripts->registered ); To see the enqueued ...


5

I will enhance my small comment on your question. But again the hint; I'm not a JS expert. The follow source, hints was only used on playing with the Customizer for different checks, examples, like my sandbox. wp.customize Understanding the WP theme customizer interface centers around understanding the wp.customize javascript object. The wp.customize ...


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