MIT License

项目介绍

devlifeX/acf-getallobjects 是一个托管在 GitHub 上的开源项目,主要使用 PHP 编写,采用 MIT License 许可证,目前获得 32 个 Star、5 次 Fork。

仓库全名
devlifeX/acf-getallobjects
开源许可证
MIT License
Star 数
32
Fork 数
5
未关闭 Issue
1

README 摘要

ACF getallobjects FOR DEVELOPERS Only! getfield has cost in front end! it means when you perform this function it calls multiple time queries as you store data in your backend. in simple words if you had 1000 text box in your acf option back-end and you call acf getfield in front-end it will call mysql query 1000 times and if you want use acf and care about your performance you will need to use this plugin or other…

完整内容见 GitHub 原始 README 或本页 。

常见问题

acf-getallobjects 用什么语言开发?

主要使用 PHP 编写,采用 MIT License 许可证,目前有 32 个 Star。

acf-getallobjects 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 acf-getallobjects 的源码?

可以直接克隆仓库:git clone https://github.com/devlifeX/acf-getallobjects.git;安装与运行步骤见仓库 README。

acf-getallobjects 最近还在维护吗?

仓库最近一次更新为 2018年10月4日,当前有 1 个未关闭 Issue;Star 数为 32,可作为社区活跃度的参考。

关于

get_field has cost in front end! it means when you perform this function it calls multiple time queries as you store data in your backend. in simple words if you had 1000 text box in your acf option back-end and you call acf get_field in front-end it will call mysql query 1000 times and if you want use acf and care about your performance you will need to use this plugin or other approciate approche.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
74
价值分
23
活跃状态
活跃

语言占比

PHP

README

ACF getallobjects

FOR DEVELOPERS Only!

get_field has cost in front end! it means when you perform this function it calls multiple time queries as you store data in your backend. in simple words if you had 1000 text box in your acf option back-end and you call acf get_field in front-end it will call mysql query 1000 times and if you want use acf and care about your performance you will need to use this plugin or other approciate approche.

Before use this plugin

alt tag

After use this plugin

alt tag

How is work?

After save acf in backend this plugin create record in Database(wp_options) with this pattern (acfAllObjects+post_id) as key and put all your fields data as whole object in value. then you instead of get_fields('foo', 'option') you can use ACFAllObj::get('foo', 'option');

How to Use?

  1. Clone or Download in your plugins directory
$ git clone https://github.com/devlifeX/acf-getallobjects.git
  1. Activate plugin from wp-admin
  2. Go to your acf post type (option or custom post type etc…) and save again (for create acfAllObjects record)
  3. Go to your theme file and replace your current code with this structure
 if (class_exists('ACFAllObj')) {   
        $foo = ACFAllObj::get('foo', 'option');
        $bar = ACFAllObj::get('bar', 'option');
    } else {
        $foo = get_field('foo', 'option');
        $bar = get_field('bar', 'option');
    }

评论

暂无评论