PR

Cocoon 汎用関数 一覧 Util.php

cocoon

汎用関数

2025.01.23

カテゴリーラベルのスタイルタグ属性を取得 function get_category_label_style_attr($cat_id){

  • リンクのないカテゴリーの取得(複数) function get_the_nolink_categories(){
  • リンクのないカテゴリーの出力(複数) function the_nolink_categories(){
  • カテゴリリンクの取得 function get_the_category_links(){
  • カテゴリリンクの出力 function the_category_links(){
  • リンクのないカテゴリーの取得 function get_the_nolink_category($id = null, $is_visible = true){
  • リンクのないカテゴリーの出力 function the_nolink_category($id = null, $is_visible = true){
  • PR表記小の出力 function generate_small_pr_label_tag(){
  • PR表記(大)の出力 function generate_large_pr_label_tag(){
  • タグリンクの取得 function get_the_tag_links(){
  • タグリンクの出力 function the_tag_links(){
  • コメントが許可されているか function is_comment_open(){
  • コメントが許可されているか(is_comment_openのエイリアス) function is_comment_allow(){
  • 現在のカテゴリーをカンマ区切りテキストで取得する function get_category_ids(){
  • AdSense用のフォーマットに変換 function to_adsense_format($format){
  • フォーマットを指定して広告テンプレートファイル呼び出す
    function get_template_part_with_ad_format($format = DATA_AD_FORMAT_AUTO, $wrap_class = null, $label_visible = 1, $ad_code = null){
  • オプション付きのテンプレート呼び出し function get_template_part_with_option($slug, $option = null){
  • スキンオプションが存在するか function is_skin_option($name){
  • スキンオプションの取得 function get_skin_option($name){
  • スキン制御があるか確認する function is_form_skin_option($name, $value = 1){
  • get_form_skin_option→is_form_skin_optionに関数変更しても互換関係を保つためのエイリアス function get_form_skin_option($name, $value = 1){
  • オプションの値をデータベースに保存する function update_theme_option($option_name){
  • オプションの値をデータベースから取得する function get_theme_option($option_name, $default = null){
  • highlight-jsのCSS URLを取得 function get_highlight_js_css_url(){
  • 親テーマstyle.cssの読み込み function wp_enqueue_style_theme_style(){
  • 親テーマkeyframes.cssの読み込み function wp_enqueue_style_theme_keyframes(){
  • 子テーマstyle.cssの読み込み function wp_enqueue_style_theme_child_style(){
  • 子テーマkeyframes.cssの読み込み function wp_enqueue_style_theme_child_keyframes(){
  • スキンスタイルの読み込み function wp_enqueue_style_theme_skin_style(){
  • スキンスタイルの読み込み function wp_enqueue_style_theme_skin_keyframes(){
  • スキンのkeyframes.css URLを取得 function get_theme_skin_keyframes_url(){
  • Font Awesomeの読み込み function wp_enqueue_style_font_awesome(){
  • IcoMoonの読み込み function wp_enqueue_style_icomoon(){
  • jQueryコアURLの取得 function get_jquery_core_url($ver){
  • jQueryコアのフルバージョンの取得 function get_jquery_core_full_version($ver){
  • jQuery MigrateURLの取得 function get_jquery_migrate_url($ver){
  • jQuery Migrateのフルバージョンの取得 function get_jquery_migrate_full_version($ver){
  • jQueryファイルの読み込み function wp_enqueue_script_jquery_js(){
  • 親テーマのjavascript.jsの読み込み function wp_enqueue_script_theme_js(){
  • Lazy Loadの読み込み
  • https://apoorv.pro/lozad.js/
  • https://qiita.com/yukagil/items/369a9972fd45223677fd
  • https://qiita.com/ryo_hisano/items/42f5980720bc832e6e09
    function wp_enqueue_lazy_load(){
  • スキンのjavascript.jsの読み込み function wp_enqueue_script_theme_skin_js(){
  • 子テーマのjavascript.jsの読み込み function wp_enqueue_script_theme_child_js(){
  • はてなシェアボタンスクリプトの読み込み function wp_enqueue_script_hatebu_share_button_js(){
  • clipboard.jsスクリプトの読み込み function wp_enqueue_script_clipboard_js(){
  • ソースコードのハイライト表示に必要なリソースの読み込み function wp_enqueue_highlight_js(){
  • Lightboxの読み込み function wp_enqueue_lightbox(){
  • lityの読み込み function wp_enqueue_lity(){
  • baguetteboxの読み込み function wp_enqueue_baguettebox(){
  • Spotlightの読み込み function wp_enqueue_spotlight(){
  • clingifyの読み込み function wp_enqueue_clingify(){
  • Slickの読み込み function wp_enqueue_slick(){
  • Swiper function wp_enqueue_swiper(){
  • SlickNav function wp_enqueue_slicknav(){
  • ScrollHint function wp_enqueue_scrollhint(){
  • clingifyの読み込み function wp_enqueue_stickyfill(){
  • Masonryの読み込み function wp_enqueue_jquery_masonry(){
  • 投稿画面ポスト時の確認ダイアログ function wp_enqueue_confirmation_before_publish(){
    function publish_confirm() {
  • Google Fontsの読み込み(Googleフォント以外のサイトフォント含む) function wp_enqueue_google_fonts(){
  • 設定変更CSSを読み込む function wp_add_css_custome_to_inline_style(){
  • 投稿を1つランダム取得 function get_random_posts($count = 1){
  • 最新の投稿を取得 function get_latest_posts($count = 1){
  • 更新日の取得(更新日がない場合はnullを返す) function get_update_time($format = null, $post_id = null) {
  • ターゲットに文字列が含まれているか function includes_string($target, $searchstr){
  • サイトアドレスが含まれているか function includes_site_url($url){
  • ホームアドレスが含まれているか function includes_home_url($url){
  • WordPressインストールフォルダが含まれているか function includes_abspath($local){
  • site_urlに対するフォルダパスが含まれているか function includes_site_path($local){
  • ホームパスが含まれているか function includes_home_path($local){
  • 内部URLをローカルパスに変更(サイトURLを置換) function url_to_local($url){
  • ローカルパスを内部URLに変更(サイトパス[ABSPATH:インストールパス]を置間) function local_to_url($local){
  • ローカルパスを内部ホームURLに変更 function local_to_home_url($local){
  • テーマのリソースディレクトリ function get_theme_resources_path(){
  • 生成アイキャッチディレクトリ function get_theme_featured_images_path(){
  • テーマの汎用キャッシュディレクトリ function get_theme_cache_path(){
  • テーマのブログカードキャッシュディレクトリ function get_theme_blog_card_cache_path(){
  • テーマのCSSキャッシュディレクトリ function get_theme_css_cache_path(){
  • テーマのPWAキャッシュディレクトリ function get_theme_pwa_cache_path(){
  • テーマのログディレクトリ function get_theme_logs_path(){
  • Amazonログファイル function get_theme_amazon_product_error_log_file(){
  • 楽天ログファイル function get_theme_rakuten_product_error_log_file(){
  • PWAのマニフェストファイルへのパス function get_theme_pwa_manifest_json_file(){
  • PWAのマニフェストファイルへのURL function get_theme_pwa_manifest_json_url(){
  • PWAのサービスワーカーへのパス function get_theme_pwa_service_worker_js_file(){
  • PWAのサービスワーカーへのパス function get_theme_pwa_service_worker_js_url(){
  • テーマのカスタムCSSファイル function get_theme_css_cache_file(){
  • テーマカスタマイザーCSSファイルの書き出し function put_theme_css_cache_file(){
  • テーマのカスタムCSSファイルURL function get_theme_css_cache_file_url(){
  • ビジュアルエディターのカスタムカラーパレットCSSファイル function get_visual_color_palette_css_cache_file(){
  • ビジュアルエディターのカスタムカラーパレットCSSファイルURL function get_visual_color_palette_css_cache_url(){
  • ブロックエディターのカスタムカラーパレットCSSファイル function get_block_color_palette_css_cache_file(){
  • ブロックエディターのカスタムカラーパレットCSSファイルURL function get_block_color_palette_css_cache_url(){
  • 画像URLから幅と高さを取得する(同サーバー内ファイルURLのみ) function get_image_width_and_height($image_url){
  • エディターページか function is_screen_editor_page(){
  • テーマ設定ページか function is_admin_php_page(){
  • 投稿新規作成ページ function is_admin_post_new_php_page(){
  • 投稿ページ function is_admin_post_php_page(){
  • テーマ設定テキストテンプレートページか function is_admin_theme_func_text_php_page(){
  • Jetpackの統計ページか function is_admin_jetpack_stats_page(){
  • Cocoon設定ページか function is_admin_cocoon_settings_page(){
  • カテゴリ・タグ・カスタム分類編集ページか function is_admin_term_php_page(){
  • 投稿・新規作成ページかどうか function is_admin_post_page(){
  • ウィジェットページか function is_widgets_php_page(){
  • サイトのドメインを取得 function get_the_site_domain(){
  • URLからドメインを取得 function get_domain_name($url){
  • 拡張子のみを取得する function get_extention($filename){
  • ファイル名のみを取得する function get_basename($filename){
  • bbPressがインストールされているか function is_bbpress_exist(){
  • bbPressのページかどうか function is_bbpress_page(){
  • BuddyPressが存在するか function is_buddypress_exist(){
  • buddypressのページかどうか function is_buddypress_page(){
  • wpForoが存在するか function is_wpforo_exist(){
  • wpforoのページかどうか function is_wpforo_plugin_page($url = ”){
  • スクロール追従領域が有効化 function is_scrollable_sidebar_enable(){
  • bbPress、BuddyPress、wpForo大インストールされているか function is_plugin_fourm_exist(){
  • bbPress、BuddyPress、wpForoフォーラムページかどうか function is_plugin_fourm_page(){
  • スクロール追従領域が有効化 function is_scrollable_main_enable(){
  • ブラウザ情報の取得 //http://web-pixy.com/php-device-browser/ function get_browser_info(){
  • サイトフォントソースコードの取得 function get_site_font_source(){
  • サイトフォントソースフォント名の取得 function get_site_font_source_family(){
  • サイトフォントソースフォントウェイト(太さ)の取得 function get_site_font_source_weight(){
  • サイトフォントソースコードURLの取得 function get_site_font_source_url(){
  • カラーコードをRGBに変換 function colorcode_to_rgb($colorcode){
  • カラーコードをRGBのCSSコードに変換 function colorcode_to_rgb_css_code($colorcode, $opacity = 0.2){
  • 投稿者が書いたページかどうか function in_authors($authers){
  • 投稿者リストページか function is_authors($authers){
  • テキストリストを配列に変換 function list_text_to_array($list){
  • Rubyタイプのデバッグ関数 function p($value){
  • フォルダごとファイルを全て削除 function remove_all_directory($dir) {
  • リダイレクト function redirect_to_url($url){
  • カンマテキストのサニタイズ function sanitize_comma_text($value){
  • 配列のサニタイズ function sanitize_array($array){
  • アクセステーブル用の現在の日時文字列 function get_current_db_date(){
  • アクセステーブル用の現在の日時文字列($days日前) function get_current_db_date_before($days){
  • ユーザーが管理者か function is_user_administrator(){
  • ファイル内容の取得
    function wp_filesystem_get_contents($file, $is_exfile = false, $credentials_enable = true){
    function get_file_contents($file){
  • ファイル内容の出力
    function wp_filesystem_put_contents($new_file, $file_data, $chmod = 0 ){
    function put_file_contents($file, $data){
  • ファイルの削除 function wp_filesystem_delete($file){
  • 最初の投稿の年を取得 function get_first_post_year(){
  • URLエンコード後の文字列を返す function get_encoded_url($url){
  • 現在表示しているページのURL function get_requested_url(){
  • クエリを取り除いたURLを取得 function get_query_removed_url($url){
  • 現在表示しているページのURL(クエリを取り除く)
    function get_query_removed_requested_url(){
    function object_to_array($object){
    function add_admin_menu_separator($position) {
  • ユーザーエージェントが、Windows Live Writer、もしくはOpen Live Writerかどうか function is_user_agent_live_writer(){
  • ユーザーエージェントがボットかどうか function is_useragent_robot(){
  • カスタムフィールドのショートコードをロケーションURIに置換
    function replace_directory_uri($code){
    function is_field_checkbox_value_default($value){
  • URL最後が/でない場合スラッシュをつける function add_delimiter_to_url_if_last_nothing($url){
  • マルチページの2ページ目以降か function is_multi_paged(){
  • 投稿日の取得 function get_the_postdate_time(){
  • 更新日の取得(更新日がないときは投稿日) function get_the_update_time(){
  • 指定されたURLはWordPressホームURLかどうか function is_home_url($url){
  • POSTリクエストか function is_server_request_post(){
  • GETリクエストか function is_server_request_get(){
  • リクエストURIがダウンロードボタンか function is_server_request_uri_backup_download_php(){
  • リクエストURIが/app/public/index.phpか(再利用ブロック対策) function is_server_request_uri_app_public_index_php(){
  • service-worker.js除外 function includes_service_worker_js_in_http_referer(){
  • cron除外 function includes_wp_cron_php_in_request_uri(){
  • 管理画面除外(再利用ブロック対策) function includes_wp_admin_in_request_uri(){
  • 現在のページでサイドバーが表示されるか function is_the_page_sidebar_visible(){
  • インデックスページでサイドバーが表示されるか function is_index_page_sidebar_visible(){
  • フロントトップページかどうか function is_front_top_page(){
  • アクセス解析を行うか function is_analytics(){
  • htmlspecialcharsを簡略化して関数化する function h($s) {
  • IDに配列が適切か function is_ids_exist($array){
  • ファビコンを取得 function get_site_favicon_url(){
  • ブログカード用のURLデコード function ampersand_urldecode($url){
  • URLパラメーターを取得 function get_url_params($url){
  • パブリシャーロゴのサイズ修正 function calc_publisher_image_sizes($width, $height){
  • ショートコードの値をサニタイズする function sanitize_shortcode_value($value){
  • 改行を削除 function remove_crlf($content){
  • wpautopがつけた段落を削除 function wpunautop($content){
  • 人間感覚的な時間取得 function get_human_time_diff_advance( $from, $to = ” ) {
  • 人間感覚の年の取得 function get_human_years_ago( $from, $unit = ” ) {
  • 文字列をBoolean型に変換 function str_to_bool($string){
  • カスタム投稿タイプの配列取得 function get_custum_post_types(){
  • カスタムポストタイプをまとめて登録 function add_meta_box_custom_post_types($id, $title, $callback, $screen = null, $context = ‘advanced’, $priority = ‘default’, $callback_args = null){
  • 別スキームのURLの取得 function get_another_scheme_url($url){
  • ブログカードの無効化を解除 function cancel_blog_card_deactivation($the_content, $is_p = true){
  • 投稿・固定ページのSNSシェア画像の取得(シェア画像優先) function get_singular_sns_share_image_url(){
  • 投稿・固定ページのアイキャッチ画像の取得(アイキャッチ優先) function get_singular_eyecatch_image_url(){
  • wpForo URLが含まれている場合 function includes_wpforo_url($url){
  • robots.txtページかどうか function is_robots_txt_page(){
  • access.phpページかどうか function is_analytics_access_php_page(){
  • ログインページかどうか function is_login_page() {
  • ホームURLを除いた文字列 function get_remove_home_url($url){
  • WordPressで設定されているタイムゾーンを取得する function get_wordpress_timezone(){
  • WordPressで設定されているメールアドレス取得する function get_wordpress_admin_email(){
  • 固定表示されている投稿IDを取得する function get_sticky_post_ids(){
  • “を\”にエスケープする function get_double_quotation_escape($str){
  • .htaccessへの書き込み関数 function add_code_to_htaccess($resoce_file, $begin, $end, $reg){
  • .htaccessのコード削除関数 function remove_code_from_htacccess($reg){
  • テキスト内にtarget=”_blank”が含まれるか function includes_target_blalk($target){
  • XMLのエスケープ function xmlspecialchars($string){
  • カンマテキストを配列にする function comma_text_to_array($comma_text){
  • エディターカラーパレット用のキーカラー function get_editor_key_color(){
  • httpコンテンツの取得 function get_http_content($url){
  • 本文を読むのにかかる時間 function get_time_to_content_read($content){
  • 内部URLからカテゴリーオブジェクトを取得する function url_to_category_object($url){
  • 内部URLからタグオブジェクトを取得する function url_to_tag_object($url){
  • 有効なショートコードアイテムを保持しているか function has_valid_shortcode_item($shortcodes){
  • 不要なショートコードを除外した文字列を返す function get_shortcode_removed_content($content){
  • get_template_partに関するフック付加 function cocoon_template_part($slug){
  • テンプレートのタグ取得 function get_template_part_tag($slug){
  • モバイルメニューボタンタグの取得 function get_mobile_navi_button_tag(){
  • モバイルホームボタンタグの取得 function get_mobile_home_button_tag(){
  • モバイル検索ボタンタグの取得 function get_mobile_search_button_tag(){
  • モバイルトップボタンタグの取得 function get_mobile_top_button_tag(){
  • モバイルサイドバーボタンタグの取得 function get_mobile_sidebar_button_tag(){
  • モバイル目次ボタンタグの取得 function get_mobile_toc_button_tag(){
  • モバイルシェアボタンタグの取得 function get_mobile_share_button_tag(){
  • モバイルフォローボタンタグの取得 function get_mobile_follow_button_tag(){
  • モバイル前へボタンタグの取得 function get_mobile_prev_button_tag(){
  • モバイル次へボタンタグの取得 function get_mobile_next_button_tag(){
  • モバイルロゴボタンタグの取得 function get_mobile_logo_button_tag(){
  • コメントボタンタグの取得 function get_mobile_comments_button_tag(){
  • 確実にホームパスを取得するget_home_path関数 function get_abs_home_path(){
  • .htaccessファイルの取得 function get_abs_htaccess_file(){
  • ブログカードコンテンツ function fix_blogcard_content($the_content){
  • タームのメタデーターが存在しているか function term_metadata_exists($term_id, $meta_key){
  • スキン制御変数をクリアしてバックアップする function clear_global_skin_theme_options(){
  • スキン制御変数を元に戻す function restore_global_skin_theme_options(){
  • 拡張エディターカラーのスタイル生成 function generate_block_editor_color_style($class, $name, $color_code, $is_all = false){?>
  • 拡張エディターカラーのスタイル取得 function get_block_editor_color_style($class, $name, $color_code, $is_all = false){
  • iOSかどうかを判定する //https://net-viz.info/archives/409/ function is_ios() {
  • Font Awesome5変換 function change_fa($buffer){
  • WordPress「表示設定」の「1ページに表示する最大投稿数」を取得する function get_option_posts_per_page(){
  • カテゴリーIDからカテゴリー名を取得 function get_category_name_by_id($id){
  • target=_blankの場合はrel=noopenerを取得 function get_rel_by_target($target){
  • 存在するカテゴリIDかどうか function is_category_exist($cat_id){
  • 管理ページが投稿か function is_admin_single(){
  • 管理ページが固定ページか function is_admin_page(){
  • URLがAmazonかどうか function is_amazon_site_page($URI){
  • URLが楽天かどうか function is_rakuten_site_page($URI){
  • 投稿の個別noindex idをすべて取得する function get_postmeta_value_enable_post_ids($meta_key){
  • カテゴリーの個別noindex idをすべて取得する function get_termmeta_value_enable_ids($meta_key){
  • WordPressバージョンが5.5以上かどうか function is_wp_5_5_or_over(){
  • WordPressバージョンが5.8以上かどうか function is_wp_5_8_or_over(){
  • WordPressバージョンが6.1以上かどうか function is_wp_6_1_or_over(){
  • WordPressバージョンが6.5以上かどうか function is_wp_6_5_or_over(){
  • WordPress5.5からのLazy Loadが有効な環境かどうか function is_wp_lazy_load_valid(){
  • エディターでページタイプでスタイルを変更する用のclassを出力
    function get_editor_page_type_class(){
    function use_gutenberg_editor(){
  • ピクセル数を数字にする function px_to_int($px){
  • //デバッグ用の関数
  • if ( !function_exists( ‘_v’ ) ):
  • function _v($v){
  • do_action( ‘qm/debug’, $v );
  • }
  • endif;
  • 著者プロフィールページのURLを取得 function get_the_auther_profile_page_url(){
  • 著者プロフィール名前を取得 function get_the_auther_profile_name(){
  • フロントページタイプの取得 function get_front_page_type_class(){
  • RESTリクエストかどうか function is_rest() {
  • HTML内のAタグをSPANタグに変換 function replace_a_tags_to_span_tags( $html ) {
  • ブロックエディター画面かどうか function is_block_editor_page() {
  • クラシックエディター画面かどうか function is_classic_editor() {
  • HTMLで使用するヘックスカラーが暗い色かどうか() function is_dark_hexcolor($hexcolor) {
  • 使用言語が韓国語かどうか function is_wp_language_korean() {
  • 文章内にtocショートコードが使われているか function is_toc_shortcode_includes($content) {
  • カレントページのURLを取得する function get_current_page_url() {
  • //////////////////////////////////////////////////
  • 以下子テーマカスタマイズ時にエラーがないようにするためのエイリアス
  • //////////////////////////////////////////////////
  • barba.jsスクリプトの読み込み function wp_enqueue_script_barba_js(){}
  • barba.jsのネームスペース function get_barba_name_space(){}
  • 文字列内のスクリプトをbarba.js用に取り出して出力する function generate_baruba_js_scripts($tag){}
  • ユニバーサルアナリティクスID
    function get_google_analytics_tracking_id(){}
  • Google Analyticsのスクリプト
    function get_google_analytics_script(){}
    function is_google_analytics_script_gtag_js(){}

cocoon

コメント