当前的sdk缺少android.app.ActivityThread(android.app.ActivityThread is missing in current sdk)
我在网上发现了一些使用
android.app.ActivityThread
例子,但是在我的android sdk安装(2.1和2.2)中找不到它,也没有在android sdk网页上找到它。
ActivityThread
已从当前的sdk中删除? 如果是这样,还有其他选择吗?谢谢托马斯
I found some examples in the web which use
android.app.ActivityThread
but I can't find it in my android sdk installation (2.1 and 2.2), and neither on the android sdk webpage.Was the
ActivityThread
removed from the current sdk? If so, is there an alternative?Thanks Thomas
原文:https://stackoverflow.com/questions/3317520
更新时间:2022-03-28 18:03
最满意答案
function do_shortcode_by_tags($content, $tags) { global $shortcode_tags; $_tags = $shortcode_tags; // store temp copy foreach ($_tags as $tag => $callback) { if (!in_array($tag, $tags)) // filter unwanted shortcode unset($shortcode_tags[$tag]); } $shortcoded = do_shortcode($content); $shortcode_tags = $_tags; // put all shortcode back return $shortcoded; }
这可以通过过滤全局
$shortcode_tags
do_shortcode()
,运行do_shortcode()
,然后将所有内容恢复原样。使用示例;
$comment = do_shortcode_by_tags($comment, array('tag_1', 'tag_2'));
这会将短代码
tag_1
和tag_2
应用于评论。function do_shortcode_by_tags($content, $tags) { global $shortcode_tags; $_tags = $shortcode_tags; // store temp copy foreach ($_tags as $tag => $callback) { if (!in_array($tag, $tags)) // filter unwanted shortcode unset($shortcode_tags[$tag]); } $shortcoded = do_shortcode($content); $shortcode_tags = $_tags; // put all shortcode back return $shortcoded; }
This works by filtering the global
$shortcode_tags
, runningdo_shortcode()
, then putting everything back as it was before.Example use;
$comment = do_shortcode_by_tags($comment, array('tag_1', 'tag_2'));
This will apply the shortcode
tag_1
andtag_2
to the comment.
相关问答
更多-
WordPress中的短代码问题(Shortcode issue in WordPress)[2020-07-20]
问题是你正在使用打印html的函数而不是返回它。 尝试这个 //blog posts shortcode add_shortcode( 'blog', 'my_recent_post' ); function my_recent_post() { global $post; $html = ""; $my_query = new WP_Query( array( 'post_type' => 'post', 'cat' => '4', ... -
function do_shortcode_by_tags($content, $tags) { global $shortcode_tags; $_tags = $shortcode_tags; // store temp copy foreach ($_tags as $tag => $callback) { if (!in_array($tag, $tags)) // filter unwanted shortcode unset($sh ...
-
PHP内的短代码(PHP within a Wordpress shortcode)[2022-02-09]
我建议你正确阅读这些内容 ,以了解为什么这些工作和你的工作没有;-)我认为必须逃避“双引号”: 要么 希望能帮助到你! I think that the "double-quote" have to be escaped:好。 我找到了解决方案。 因为短代码在循环之外,所以使其工作的方式是。 如果您有更好的解决方案,请分享。 OK. i found the solution. Because the shortcode is outside of the loop, so the way to make it work is . If you have better solution, please share it.错误的引用/撇号在开始和结束时使用: do_shortcode('[cvg-video videoId='2' width='600' height='600' mode='playlist' /]'); 应该读 echo do_shortcode("[cvg-video videoId='2' width='600' height='600' mode='playlist' /]"); Wrong quote/apostrophe used right at beginning and end: do ...将此代码放在weather.php文件的顶部 include_once("ADJUST/PATH/wp-load.php"); wp-load.php文件位于WordPress安装的主目录中。 Place this code at the top of the weather.php file include_once("ADJUST/PATH/wp-load.php"); The wp-load.php file is found in the main directory of your WordP ...你不能像这样调用AJAX调用首先你需要注册AJAX调用然后发送请求给admin-ajax.php 看看这个。 add_action('wp_ajax_nopriv_unread_messages', 'unread_messages'); add_action('wp_ajax_unread_messages', 'unread_messages'); function unread_messages(){ $output['response'] = do_shortcode('[unrea ...好的,所以我想出了问题,如果有其他人需要这个: 问题是,当添加标签时,它会破坏标题标签,而不会显示任何内容。 所以我编辑了代码,所以我可以输入另一个值,然后将其显示在标题左侧: function minti_toggle($atts, $content = null) { extract(shortcode_atts(array( 'title' => '', 'image' => '' ), $atts)); return '在PHP 5.3+中你有闭包。 $shortcode_name = 'awesome'; ${"{$shortcode_name}_fn"} = function($atts) { print('Awesome shortcode'); }; add_shortcode($shortcode_name, ${"{$shortcode_name}_fn"}); 您还可以使用变量变量名称,在这种情况下,包含该函数的变量名为:awesome_fn。 In PHP 5.3+ you have closures ...相关文章
更多- [译文] 恶意软件行为综述 - A View on Current Malware Behaviors
- 请问下,ophone sdk对应的android版本是几呢?Android开发的应用能否在ophone上运行嗯?
- 使用代理解决Android SDK Manager下载太慢的问题
- 微信Android SDK示例代码及运行方法
- android 不调用微信,易信等SDK实现实现一键分享图片文字到微信,易信,以及全部可选app
- 微信开发SDK
- qq微信c#sdk
- android sdk Manager打开一闪而过的解决方案
- 在Eclipse中查看SDK源代码的方法
- iOS 关于微信检测SDK应用的原理浅析
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)