إظهار الروابط الدائمة Permalinks في لوحة تحكم ووردبريس

مرحباً بك،

يسعدني أن أشارك معك كود الـــ (PHP) أدناه لاستخدامه في الوردبريس، آملًا أن يكون مفيدًا لك في رحلتك التصميمة الإبداعية.

اسمي زياد عرمان،

متخصص في تصميم المواقع الإلكترونية،  ومساعدة الشركات والأفراد على بناء تواجد رقمي حقيقي.


👈 لإضافة الكود البرمجي بسهولة إلى موقعك على ووردبريس، يمكنك استخدام إضافة Code Snippets المتوفرة عبر الرابط التالي:

وظيفة الكود:

يعمل هذا الكود على إظهار الروابط الدائمة (Permalinks) بشكل مباشر داخل لوحة تحكم ووردبريس، مما يسهل عليك نسخ الروابط والوصول السريع إليها بدون الحاجة لفتح كل صفحة أو مقالة بشكل منفصل.

// Add a "PermaLink" column to all post types.
function add_permalink_column_to_all_post_types($columns) {
    $columns['permalink'] = 'permalink';
    return $columns;
}

// Show link inside column
function show_permalink_column_for_all_post_types($column, $post_id) {
    if ($column == 'permalink') {
        $permalink = get_permalink($post_id);
        echo '' . esc_url($permalink) . '';
    }
}

// Apply the code to all types of public posts
function apply_permalink_column_to_all_post_types() {
    $post_types = get_post_types(['public' => true], 'names');

    foreach ($post_types as $post_type) {
        add_filter("manage_{$post_type}_posts_columns", 'add_permalink_column_to_all_post_types');
        add_action("manage_{$post_type}_posts_custom_column", 'show_permalink_column_for_all_post_types', 10, 2);
    }
}
add_action('admin_init', 'apply_permalink_column_to_all_post_types');

فقط قم بنسخ الرباط وإدراجه ضمن Sipppte جديدة وفعله على الموقع كاملاً

النتيجة النهائية بعد تثبيت الكود 👇

بإمكانك تنزيل الكود أيضاً بصيغة PDF 👇

أعدك أن تكون محادثة غنية ومفيدة لمشروعك

أضمن لك ذلك بإذن الله