Support Forum » User Profile

Forum Replies Created

Viewing 11 posts - 31 through 41 (of 41 total)
  • Author
    Posts
  • in reply to: Polylang and Metabox compatibility #44351
    pixluserpixluser
    Participant
    in reply to: Polylang and Metabox compatibility #44350
    pixluserpixluser
    Participant

    Meta Box and PolyLang

    in reply to: Translate MetaBox Custom Post Type Name and Slug via Polylang #44311
    pixluserpixluser
    Participant

    Hello wizible, you can simply change the 'Custom rewrite slug' in the advanced tab of a metabox custom post type.
    (It works with polylang pro). They will appear in translation sub menu.
    Hope it helps!

    in reply to: Import/Export custom post with relationship field #44255
    pixluserpixluser
    Participant

    // the export code should be this one. (can't edit post here)

    // Change these table names if needed
    $table_relationships = $wpdb->prefix . 'mb_relationships';
    $table_relationships_items = $wpdb->prefix . 'mb_relationships_items';

    $relationships_data = $wpdb->get_results("
    SELECT * FROM $table_relationships
    JOIN $table_relationships_items ON $table_relationships.ID = $table_relationships_items.relationship_id
    ", ARRAY_A);

    // Prepare data in a suitable format for export
    $export_data = array();

    foreach ($relationships_data as $relationship) {
    $relationship_id = $relationship['relationship_id'];

    // Group relationships by their ID
    if (!isset($export_data[$relationship_id])) {
    $export_data[$relationship_id] = array(
    'id' => $relationship_id,
    'name' => $relationship['name'],
    'type' => $relationship['type'],
    'description' => $relationship['description'],
    'items' => array()
    );
    }

    // Add items related to this relationship
    $export_data[$relationship_id]['items'][] = array(
    'id' => $relationship['item_id'],
    'type' => $relationship['item_type'],
    // Add other item fields as needed
    );
    }

    in reply to: Import/Export custom post with relationship field #44254
    pixluserpixluser
    Participant

    I aked chatgpt to add that feature into wordpress. I don't know if it can works. Gotta try it now.

    <?php
    /*
    Plugin Name: Metabox Relationships Export/Import
    Description: Export and import Metabox Relationships data in JSON format.
    Version: 1.0
    Author: Your Name
    */
    
    // Export Metabox Relationships data as JSON
    function export_metabox_relationships_as_json() {
        global $wpdb;
    
        // ... (same export code as before) ...
    
        // Output the JSON for download
        header('Content-disposition: attachment; filename=metabox_relationships_export.json');
        header('Content-type: application/json');
        echo $json_data;
        exit;
    }
    
    // Import Metabox Relationships data from JSON
    function import_metabox_relationships_from_json() {
        if (isset($_FILES['metabox_relationships_json'])) {
            $json_data = file_get_contents($_FILES['metabox_relationships_json']['tmp_name']);
    
            // Decode JSON data
            $import_data = json_decode($json_data, true);
    
            if ($import_data) {
                // Process and import relationships data here
                // ... (import code) ...
                // Ensure data validation and use Metabox Relationships API to import
            } else {
                // Handle JSON decoding error
                echo "Invalid JSON data!";
            }
        }
    }
    
    // Create admin menu items for export/import
    function add_metabox_relationships_menu() {
        add_menu_page(
            'Metabox Relationships Export',
            'Metabox Relationships',
            'manage_options',
            'metabox-relationships-export',
            'export_metabox_relationships_as_json'
        );
    
        add_submenu_page(
            'metabox-relationships-export',
            'Import Metabox Relationships',
            'Import',
            'manage_options',
            'metabox-relationships-import',
            'import_metabox_relationships_page'
        );
    }
    
    // HTML for import page
    function import_metabox_relationships_page() {
        ?>
        <div class="wrap">
            <h1>Import Metabox Relationships</h1>
            <form method="post" enctype="multipart/form-data">
                <input type="file" name="metabox_relationships_json">
                <?php submit_button('Import Relationships'); ?>
            </form>
        </div>
        <?php
    }
    
    // Hook functions to admin menu and actions
    add_action('admin_menu', 'add_metabox_relationships_menu');
    add_action('admin_post_import_metabox_relationships', 'import_metabox_relationships_from_json');
    
    in reply to: Import/Export custom post with relationship field #44253
    pixluserpixluser
    Participant

    Hello Metabox. I think you really should add an import/export .CSV that support the relationship.
    It's such a gigantic work to do by hand.
    Is it possible to do that with WP Ultimate CSV Importer ?

    pixluserpixluser
    Participant

    Is it planned to update it?

    pixluserpixluser
    Participant

    Hello,

    Ok, that's very bad, because people can also embed pictures into their text… Is there a way to remove this option?

    in reply to: Error loading of bloc : settings incorect : attributes #43877
    pixluserpixluser
    Participant

    Hello I juste add a metabox submission form into gutemberg, and then save.
    And then reload the page.

    And I have the error displayed: (translated) : Error loading of block : settings incorect : attributes

    in reply to: File database (exchange) between users. #31096
    pixluserpixluser
    Participant

    Hi Thanks Long!,

    I was thinking about that too… but maybe can be more challenging to do in Oxygen builder 😉 I'll see 🙂

    The files will be saved into the wordpress Medias I guess, or it's also possible to have them saved into a local directory (in sync with taxonomy 'folder' name…) ?

    Thanks!

    in reply to: Create an user listing using views? #28639
    pixluserpixluser
    Participant

    Hello Long Nguyen, thanks a lot, that's what I needed thanks.

    I think that it could be usefull for the MB views users to get a new component in views :

    "the user loop".

    to get this :

    {% set users = mb.get_users( args ) %}

    {% for user in users %}
    {% set user_id = user.ID %}
    {% endfor %}

Viewing 11 posts - 31 through 41 (of 41 total)