WordPress.org

Ready to get started?Download WordPress

Forums

Custom Field Taxonomies
Don't delete Custom Fields (6 posts)

  1. Rami Yushuvaev
    Member
    Posted 3 years ago #

    When using the Custom Field Taxonomies plugin, it conterts Custom Fields to Custom Taxonomies. The plugin creates new taxonomy terms and deletes the old custom fields.

    i dont want it to delete the custom fields, what showld i do (whic code line to delete) so that the custom fields will not be deleted?

    http://wordpress.org/extend/plugins/custom-field-taxonomies/

  2. wellbrasil
    Member
    Posted 2 years ago #

    plugin folder

    open > admin.php

    del line 59
    this line:
    $r = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $cf_key ) );

    and edit this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  3. Rami Yushuvaev
    Member
    Posted 2 years ago #

    ?

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    You could just replace the line he mentioned with this:

    $r = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = %s", $cf_key ) );
  5. Rami Yushuvaev
    Member
    Posted 2 years ago #

    yes, i understand that part, but what about

    and edit this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  6. yyyyyywhy
    Member
    Posted 2 years ago #

    can't find the line 59 mentioned by wellbrasil
    no such line...what i found is this(line 56~61):

    $rows = $wpdb->get_results( $wpdb->prepare( "
    SELECT post_id, GROUP_CONCAT( meta_value ) as terms
    FROM $wpdb->postmeta
    WHERE meta_key = %s
    GROUP BY post_id
    ", $cf_key ) );

    the only line with "DELETE" inside admin.php is :

    line 92 return $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $cf_key ) );

    Mr.Scribu or Mr.Wellbrasil, would you pls help tell me what to do now in my situation? i also don't want to delete the custom fields just the same as Mr.Rami Y

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic