Forum Replies Created
-
AuthorPosts
-
pixluser
Participant
January 17, 2024 at 12:23 PM in reply to: Translate MetaBox Custom Post Type Name and Slug via Polylang #44311pixluser
ParticipantHello 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!pixluser
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
);
}pixluser
ParticipantI 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');pixluser
ParticipantHello 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 ?November 23, 2023 at 7:31 AM in reply to: ✅Fontend submission : classic type content -- convert to blocks? #43895pixluser
ParticipantIs it planned to update it?
November 22, 2023 at 11:38 PM in reply to: ✅Fontend submission : classic type content -- convert to blocks? #43889pixluser
ParticipantHello,
Ok, that's very bad, because people can also embed pictures into their text… Is there a way to remove this option?
November 22, 2023 at 11:00 AM in reply to: Error loading of bloc : settings incorect : attributes #43877pixluser
ParticipantHello 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
pixluser
ParticipantHi 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!
pixluser
ParticipantHello 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 %} -
AuthorPosts