管理画面のメニュー制御(サイド、管理バー)

// 管理サイドバーメニューの非表示 function remove_menus(){ $user = wp_get_current_user(); if( $user-> get(‘user_login’) !== “admin_99”) { remove_menu_page( ‘edit.php?post_type=cta’ ); // CTA管理 remove_menu_page( ‘edit.php?post_type=aftag’ ); // タグ管理 remove_menu_page( ‘edit.php?post_type=afranking’ ); // タグランキング remove_menu_page( ‘siteguard’ ); remove_menu_page( ‘snippets’ ); remove_menu_page( ‘pmxe-admin-export’ ); remove_menu_page( ‘pmxi-admin-import’ );…Continue reading

投稿一覧にスラッグを表示

//投稿一覧にスラッグ表示 function add_posts_columns_slug($columns) { $columns[‘slug’] = ‘スラッグ’; return $columns; } function add_posts_columns_slug_row($column_name, $post_id) { if( ‘slug’ == $column_name ) { $slug = get_post($post_id) -> post_name; echo $slug; } } add_filter( ‘manage_edit-post_sortable_columns’, ‘add_posts_columns_slug’ ); add_filter( ‘manage_posts_columns’, ‘add_posts_columns_slug’ ); add_action( ‘manage_posts_custom_column’, ‘add_posts_columns_slug_row’,…Continue reading

Migrate Order Actions Completed Date from Notes

add_action( ‘shutdown’, ‘advads_schedule_order_notes_to_set_actions_run’ ); /** * Schedule the order notes to set actions run cron event. * * @return void */ function prefix_schedule_order_notes_to_set_actions_run() { // This option is added when no more notes can be found. if ( get_option( ‘prefix_use_order_notes_to_set_actions_run’…Continue reading

Stop EDD Mailchimp Sync

add_action( ‘admin_footer’, ‘prefix_mailchimp_stop_sync’ ); /** * Stop the Mailchimp sync from running. * This is a temporary function to stop the sync from running and can be deleted once the sync is stopped. * * @return void */ function prefix_mailchimp_stop_sync()…Continue reading

Fix 500 Internal Server Error

# BEGIN WordPress RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPressContinue reading