Forum Replies Created

Viewing 4 replies - 16 through 19 (of 19 total)
  • Hey, I know this is old, but if you want to use $_POST to update the description of the updated file, you can use the following code. $_POST[‘name’] corresponds to name=”name”?in the shortcode form, and ‘post_content’ is the description field (‘post_excerpt’ is the caption field). Hope that helps somebody!

    add_action( 'fu_after_upload', 'my_fu_after_upload' );
    
    function my_fu_after_upload( $attachment_ids ) {
        // do something with freshly uploaded files
        // This happens on POST request, so $_POST will also be available for you
        foreach( $attachment_ids as $att_id ) {
    		// Format the title
        	$author = $_POST['name'];
        	$author .= ' ' . $_POST['email'];
    		// Change the description
    		$description = 'Upload by ' . $_POST['name'];
    		$description .= ', ' . $_POST['email'];
    		$description .= ' ' . $_POST['post_title'];
        	// Sanitize input from user
        	$author = sanitize_text_field( $author );
        	wp_update_post( array( 'ID' => $att_id, 'post_title' => $author, 'post_content' => $description ) );
        }
    }
    Forum: Plugins
    In reply to: Flexible upload

    I have the same problem here. Throws an error same as above. Any fix for this on 2.8?

    J

    And I have another question…

    I am using link_after in wp_list_pages and trying to incorporate the meta data from each page. In this case it’s part of a url to an image in order to reconstruct an img tag.

    So

    <?php
    wp_list_pages('title_li=&child_of=3&link_after=<img src="' .
    bloginfo('siteurl') .
    get_post_custom_values('the_key', $id) . '.jpg'); ?>

    Obviously this is wrong, but how do I retrieve that data during the wp_list_pages function?

    @vasilescu_anton the easiest way is probably through CSS. Just identify the container (probably something like ‘#sidebar ul li’ in your theme’s ‘style.css’) and change the li:before and put in the hex code for the character you want.

    Try adding

    #sidebar ul ul li:before {
    content: “0BB 020”;
    }

Viewing 4 replies - 16 through 19 (of 19 total)